Various code cleanup [skip ci]

This commit is contained in:
James Cole
2018-03-10 22:38:20 +01:00
parent a55d18709c
commit aad0864018
59 changed files with 118 additions and 120 deletions

View File

@@ -26,13 +26,14 @@ class Installer
*/
public function handle($request, Closure $next)
{
if(env('APP_ENV') === 'testing') {
if (env('APP_ENV') === 'testing') {
return $next($request);
}
$url = $request->url();
$url = $request->url();
$strpos = stripos($url, '/install');
if (!($strpos === false)) {
Log::debug(sprintf('URL is %s, will NOT run installer middleware', $url));
return $next($request);
}
Log::debug(sprintf('URL is %s, will run installer middleware', $url));
@@ -59,13 +60,16 @@ class Installer
$configVersion = intval(config('firefly.db_version'));
$dbVersion = intval(FireflyConfig::getFresh('db_version', 1)->data);
if ($configVersion > $dbVersion) {
Log::warning(sprintf(
'The current installed version (%d) is older than the required version (%d). Redirect to migrate routine.', $dbVersion, $configVersion
));
Log::warning(
sprintf(
'The current installed version (%d) is older than the required version (%d). Redirect to migrate routine.', $dbVersion, $configVersion
)
);
// redirect to migrate routine:
return response()->redirectTo(route('installer.index'));
}
return $next($request);
}