Merge cachet:install and app:install
This commit is contained in:
@@ -1,76 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Cachet.
|
|
||||||
*
|
|
||||||
* (c) Alt Three Services Limited
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace CachetHQ\Cachet\Console\Commands;
|
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the app install command.
|
|
||||||
*
|
|
||||||
* @author James Brooks <james@alt-three.com>
|
|
||||||
*/
|
|
||||||
class AppInstallCommand extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'app:install';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Installs the application';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The events instance.
|
|
||||||
*
|
|
||||||
* @var \Illuminate\Contracts\Events\Dispatcher
|
|
||||||
*/
|
|
||||||
protected $events;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(Dispatcher $events)
|
|
||||||
{
|
|
||||||
$this->events = $events;
|
|
||||||
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
$this->events->fire('command.installing', $this);
|
|
||||||
$this->events->fire('command.generatekey', $this);
|
|
||||||
$this->events->fire('command.cacheconfig', $this);
|
|
||||||
$this->events->fire('command.cacheroutes', $this);
|
|
||||||
$this->events->fire('command.publishvendors', $this);
|
|
||||||
$this->events->fire('command.runmigrations', $this);
|
|
||||||
$this->events->fire('command.runseeding', $this);
|
|
||||||
$this->events->fire('command.updatecache', $this);
|
|
||||||
$this->events->fire('command.linkstorage', $this);
|
|
||||||
$this->events->fire('command.extrastuff', $this);
|
|
||||||
$this->events->fire('command.installed', $this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Console\Commands;
|
|||||||
use Dotenv\Dotenv;
|
use Dotenv\Dotenv;
|
||||||
use Dotenv\Exception\InvalidPathException;
|
use Dotenv\Exception\InvalidPathException;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the install command class.
|
* This is the install command class.
|
||||||
@@ -36,6 +37,25 @@ class InstallCommand extends Command
|
|||||||
*/
|
*/
|
||||||
protected $description = 'Install Cachet';
|
protected $description = 'Install Cachet';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The events instance.
|
||||||
|
*
|
||||||
|
* @var \Illuminate\Contracts\Events\Dispatcher
|
||||||
|
*/
|
||||||
|
protected $events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @param Dispatcher $events
|
||||||
|
*/
|
||||||
|
public function __construct(Dispatcher $events)
|
||||||
|
{
|
||||||
|
$this->events = $events;
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
@@ -43,18 +63,28 @@ class InstallCommand extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
if (!$this->confirm('Do you want to install Cachet?')) {
|
if ($this->confirm('Do you want to configure Cachet before installing?')) {
|
||||||
$this->line('Installation aborted. Goodbye!');
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->configureEnvironmentFile();
|
$this->configureEnvironmentFile();
|
||||||
$this->configureKey();
|
$this->configureKey();
|
||||||
$this->configureDatabase();
|
$this->configureDatabase();
|
||||||
$this->configureDrivers();
|
$this->configureDrivers();
|
||||||
$this->configureMail();
|
$this->configureMail();
|
||||||
$this->configureCachet();
|
$this->configureCachet();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->line('Installing Cachet...');
|
||||||
|
|
||||||
|
$this->events->fire('command.installing', $this);
|
||||||
|
$this->events->fire('command.generatekey', $this);
|
||||||
|
$this->events->fire('command.cacheconfig', $this);
|
||||||
|
$this->events->fire('command.cacheroutes', $this);
|
||||||
|
$this->events->fire('command.publishvendors', $this);
|
||||||
|
$this->events->fire('command.runmigrations', $this);
|
||||||
|
$this->events->fire('command.runseeding', $this);
|
||||||
|
$this->events->fire('command.updatecache', $this);
|
||||||
|
$this->events->fire('command.linkstorage', $this);
|
||||||
|
$this->events->fire('command.extrastuff', $this);
|
||||||
|
$this->events->fire('command.installed', $this);
|
||||||
|
|
||||||
$this->info('Cachet is installed ⚡');
|
$this->info('Cachet is installed ⚡');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user