Use class notation

This commit is contained in:
James Brooks
2017-01-05 19:25:51 +00:00
committed by James Brooks
parent 98b213bb62
commit ce9a732317

View File

@@ -16,6 +16,7 @@ use Dotenv\Dotenv;
use Dotenv\Exception\InvalidPathException; use Dotenv\Exception\InvalidPathException;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Console\Kernel;
/** /**
* This is the install command class. * This is the install command class.
@@ -71,9 +72,9 @@ class InstallCommand extends Command
$this->configureDrivers(); $this->configureDrivers();
$this->configureMail(); $this->configureMail();
$this->configureCachet(); $this->configureCachet();
$this->configureUser();
} }
<<<<<<< HEAD
$this->line('Installing Cachet...'); $this->line('Installing Cachet...');
$this->events->fire('command.installing', $this); $this->events->fire('command.installing', $this);
@@ -87,15 +88,6 @@ class InstallCommand extends Command
$this->events->fire('command.linkstorage', $this); $this->events->fire('command.linkstorage', $this);
$this->events->fire('command.extrastuff', $this); $this->events->fire('command.extrastuff', $this);
$this->events->fire('command.installed', $this); $this->events->fire('command.installed', $this);
=======
$this->configureEnvironmentFile();
$this->configureKey();
$this->configureDatabase();
$this->configureDrivers();
$this->configureMail();
$this->configureCachet();
$this->configureUser();
>>>>>>> Add user on cachet install command
$this->info('Cachet is installed ⚡'); $this->info('Cachet is installed ⚡');
} }
@@ -150,15 +142,9 @@ class InstallCommand extends Command
], $default); ], $default);
$config['DB_DRIVER'] = $this->choice('Which database driver do you want to use?', [ $config['DB_DRIVER'] = $this->choice('Which database driver do you want to use?', [
<<<<<<< HEAD
'mysql' => 'MySQL', 'mysql' => 'MySQL',
'pgsql' => 'PostgreSQL', 'pgsql' => 'PostgreSQL',
'sqlite' => 'SQLite', 'sqlite' => 'SQLite',
=======
'mysql' => 'MySQL',
'pgsql' => 'PostgreSQL',
'sqlite' => 'SQLite',
>>>>>>> Add user on cachet install command
], $config['DB_DRIVER']); ], $config['DB_DRIVER']);
if ($config['DB_DRIVER'] === 'sqlite') { if ($config['DB_DRIVER'] === 'sqlite') {
@@ -329,7 +315,7 @@ class InstallCommand extends Command
/** /**
* Configure Cachet. * Configure Cachet.
* *
* @param array $config * @param array $config
* *
* @return void * @return void
@@ -352,7 +338,7 @@ class InstallCommand extends Command
} }
/** /**
* Configure the fisrt user. * Configure the first user.
* *
* @return void * @return void
*/ */
@@ -364,17 +350,17 @@ class InstallCommand extends Command
// We need to refresh the config to get access to the newly connected database. // We need to refresh the config to get access to the newly connected database.
$this->getFreshConfiguration(); $this->getFreshConfiguration();
// Now we need to install the application. // Now we need to install the application.
$this->call('app:install'); // $this->call('cachet:install');
$user = [ $user = [
'username' => $this->ask('Please enter your username'), 'username' => $this->ask('Please enter your username'),
'email' => $this->ask('Please enter your email'), 'email' => $this->ask('Please enter your email'),
'password' => $this->secret('Please enter your password'), 'password' => $this->secret('Please enter your password'),
'level' => User::LEVEL_ADMIN, 'level' => User::LEVEL_ADMIN,
]; ];
User::create($user); User::create($user);
} }
@@ -426,8 +412,7 @@ class InstallCommand extends Command
protected function getFreshConfiguration() protected function getFreshConfiguration()
{ {
$app = require $this->laravel->bootstrapPath().'/app.php'; $app = require $this->laravel->bootstrapPath().'/app.php';
$app->make(Kernel::class)->bootstrap();
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
} }
/** /**