Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
webbingbrasil/core-module / Commands / InstallCommand.php
Size: Mime:
<?php
/**
 * Created by PhpStorm.
 * User: danilo
 * Date: 18/12/15
 * Time: 10:58
 */
namespace Modules\Core\Commands;

use Illuminate\Console\Command;
use Modules\Core\Commands\Installers\Installer;
use Modules\Core\Commands\Installers\Traits\BlockMessage;
use Modules\Core\Commands\Installers\Traits\SectionMessage;
use Symfony\Component\Console\Input\InputOption;

class InstallCommand extends Command
{
    use BlockMessage, SectionMessage;

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'webbing:install';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install Webbing CMS';

    /**
     * @var Installer
     */
    private $installer;

    /**
     * Create a new command instance.
     *
     * @param Installer $installer
     * @internal param Filesystem $finder
     * @internal param Application $app
     * @internal param Composer $composer
     */
    public function __construct(Installer $installer)
    {
        parent::__construct();
        $this->getLaravel()['env'] = 'local';
        $this->installer = $installer;
    }

    /**
     * Execute the actions
     *
     * @return mixed
     */
    public function fire()
    {
        $this->blockMessage('Welcome to Webbing CMS!', 'Starting the installation process...', 'comment');

        $success = $this->installer->stack([
            'Modules\Core\Commands\Installers\Scripts\ProtectInstaller',
            'Modules\Core\Commands\Installers\Scripts\ConfigureDatabase',
            'Modules\Core\Commands\Installers\Scripts\SetAppKey',
            'Modules\Core\Commands\Installers\Scripts\ModuleEnable',
            'Modules\Core\Commands\Installers\Scripts\ConfigureUserProvider',
            'Modules\Core\Commands\Installers\Scripts\ModuleMigrator',
            'Modules\Core\Commands\Installers\Scripts\ModuleSeeders',
            'Modules\Core\Commands\Installers\Scripts\ModuleAssets',
            'Modules\Core\Commands\Installers\Scripts\ThemeAssets',
            'Modules\Core\Commands\Installers\Scripts\OptimizeInstall',
        ])->install($this);

        if ($success) {
            $this->info('Platform ready! You can now login with your username and password at /' . config('core.admin-prefix', 'painel'));
        }
    }

    protected function getOptions()
    {
        return [
            ['force', 'f', InputOption::VALUE_NONE, 'Force the installation, even if already installed']
        ];
    }
}