Commit 9cdb2016 authored by Nicolas Widart's avatar Nicolas Widart

Add a check if the platform has already been installed

parent 6b4da4d6
......@@ -60,6 +60,11 @@ class InstallCommand extends Command
{
$this->info('Starting the installation process...');
if ($this->checkIfInstalled()) {
$this->error('Asgard has already been installed. You can already log into your administration.');
return;
}
$this->configureDatabase();
$userDriver = $this->choice('Which user driver do you wish to use?', ['Sentinel', 'Sentry'], 1);
......@@ -340,4 +345,16 @@ class InstallCommand extends Command
$this->composer->remove('cartalyst/sentry');
}
/**
* Check if Asgard CMS already has been installed
*/
private function checkIfInstalled()
{
$users = $this->app['db']->table('users')->get();
if ($users) {
return true;
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment