refs #5: Version number is now saved to the configuration table. Database sessions are enabled once the database is up and running

This commit is contained in:
Andy Heathershaw 2016-10-06 16:58:02 +01:00
parent a41f8bede3
commit f9bafeb91e

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Configuration; use App\Configuration;
use App\Facade\UserConfig;
use App\Helpers\MiscHelper; use App\Helpers\MiscHelper;
use App\Http\Requests\StoreUserRequest; use App\Http\Requests\StoreUserRequest;
use App\User; use App\User;
@ -155,16 +156,12 @@ class InstallController extends Controller
Artisan::call('cache:clear'); Artisan::call('cache:clear');
Artisan::call('migrate', ['--force' => true]); Artisan::call('migrate', ['--force' => true]);
$result = Configuration::where('key', 'install_completed')->first(); $versionNumber = UserConfig::getOrCreateModel('app_version');
if (is_null($result)) $versionNumber->value = config('app.version');
{ $versionNumber->save();
$result = new Configuration();
$result->key = 'install_completed';
$result->value = true;
$result->save();
}
// Now the database is up-to-date, we can enable database sessions // Now the database is up-to-date, we can enable database sessions
MiscHelper::setEnvironmentSetting('SESSION_DRIVER', 'database');
$request->session()->set('install_stage', 3); $request->session()->set('install_stage', 3);
return redirect(route('install.administrator')); return redirect(route('install.administrator'));