Файл: concrete5.7.5.6/concrete/src/Console/Application.php
Строк: 168
<?php
namespace ConcreteCoreConsole;
use Core;
use Database;
use DoctrineORMToolsConsoleConsoleRunner;
use ConcreteCoreUpdaterMigrationsConfiguration as MigrationsConfiguration;
class Application extends SymfonyComponentConsoleApplication
{
public function __construct()
{
parent::__construct('concrete5', Config::get('concrete.version'));
}
public function setupDefaultCommands()
{
$this->add(new CommandInstallCommand());
$this->add(new CommandTranslatePackageCommand());
$this->add(new CommandGenerateIDESymbolsCommand());
$this->add(new CommandConfigCommand());
$this->add(new CommandPackPackageCommand());
if (Core::make('app')->isInstalled()) {
$this->add(new CommandClearCacheCommand());
$this->add(new CommandInstallPackageCommand());
$this->add(new CommandUninstallPackageCommand());
$this->add(new CommandUpdatePackageCommand());
}
$this->setupRestrictedCommands();
$this->setupDoctrineCommands();
}
public function setupRestrictedCommands()
{
$this->add(new CommandResetCommand());
if (Core::make('app')->isInstalled()) {
$this->add(new CommandJobCommand());
}
}
public function setupDoctrineCommands()
{
if (!Core::make('app')->isInstalled()) {
return;
}
$cn = Database::connection();
$helperSet = ConsoleRunner::createHelperSet($cn->getEntityManager());
$this->setHelperSet($helperSet);
$migrationsConfiguration = new MigrationsConfiguration();
/** @var DoctrineDBALMigrationsToolsConsoleCommandAbstractCommand[] $commands */
$commands = array(
new DoctrineDBALMigrationsToolsConsoleCommandDiffCommand(),
new DoctrineDBALMigrationsToolsConsoleCommandExecuteCommand(),
new DoctrineDBALMigrationsToolsConsoleCommandGenerateCommand(),
new DoctrineDBALMigrationsToolsConsoleCommandMigrateCommand(),
new DoctrineDBALMigrationsToolsConsoleCommandStatusCommand(),
new DoctrineDBALMigrationsToolsConsoleCommandVersionCommand(),
);
foreach ($commands as $migrationsCommand) {
$migrationsCommand->setMigrationConfiguration($migrationsConfiguration);
$this->add($migrationsCommand);
}
ConsoleRunner::addCommands($this);
}
}