本文整理汇总了PHP中Symfony\Component\Console\Application::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::__construct方法的具体用法?PHP Application::__construct怎么用?PHP Application::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Application
的用法示例。
在下文中一共展示了Application::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* {@inheritdoc}
*/
public function __construct()
{
parent::__construct('Symplify Coding Standard', null);
$runnerCollection = $this->createAndFillRunnerCollection();
$this->add(new CheckCommand($runnerCollection));
$this->add(new FixCommand($runnerCollection));
}
示例2: __construct
/**
* Create a new application instance.
*
* @return void
*/
public function __construct()
{
parent::__construct('Climb', self::VERSION);
$this->add(new OutdatedCommand());
$this->add(new GlobalCommand());
$this->setDefaultCommand('outdated');
}
示例3: __construct
/**
* Instantiate the class
*
*/
public function __construct($appName, $appVersion)
{
parent::__construct($appName, $appVersion);
foreach ($this->commands as $command) {
$this->add(new $command());
}
}
示例4: __construct
/**
* @SuppressWarnings(PHPMD.ExitExpression)
*/
public function __construct()
{
// Creation
parent::__construct('Release Management Tool', RMT_VERSION);
self::$instance = $this;
// Change the current directory in favor of the project root folder,
// this allow to run the task from outside the project like:
// $/home/www> myproject/RMT release
chdir($this->getProjectRootDir());
// Add all command, in a controlled way and render exception if any
try {
// Add the default command
$this->add(new InitCommand());
// Add command that require the config file
if (file_exists($this->getConfigFilePath())) {
$this->add(new ReleaseCommand());
$this->add(new CurrentCommand());
$this->add(new ChangesCommand());
$this->add(new ConfigCommand());
}
} catch (\Exception $e) {
$output = new \Liip\RMT\Output\Output();
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$this->renderException($e, $output);
exit(1);
}
}
示例5: __construct
/**
* @param string $name application name
* @param string $version application version
* @SuppressWarnings(PHPMD.ExitExpression)
*/
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
{
$this->serviceManager = \Zend\Mvc\Application::init(require BP . '/setup/config/application.config.php')->getServiceManager();
$generationDirectoryAccess = new GenerationDirectoryAccess($this->serviceManager);
if (!$generationDirectoryAccess->check()) {
$output = new ConsoleOutput();
$output->writeln('<error>Command line user does not have read and write permissions on var/generation directory. Please' . ' address this issue before using Magento command line.</error>');
exit(0);
}
/**
* Temporary workaround until the compiler is able to clear the generation directory
* @todo remove after MAGETWO-44493 resolved
*/
if (class_exists(CompilerPreparation::class)) {
$compilerPreparation = new CompilerPreparation($this->serviceManager, new ArgvInput(), new File());
$compilerPreparation->handleCompilerEnvironment();
}
if ($version == 'UNKNOWN') {
$directoryList = new DirectoryList(BP);
$composerJsonFinder = new ComposerJsonFinder($directoryList);
$productMetadata = new ProductMetadata($composerJsonFinder);
$version = $productMetadata->getVersion();
}
parent::__construct($name, $version);
}
示例6: __construct
/**
* Constructor.
*/
public function __construct()
{
error_reporting(-1);
parent::__construct('PHP Speller', PhpSpeller::VERSION);
$this->add(new CheckCommand());
$this->add(new InfoCommand());
}
示例7: __construct
/**
* Constructor.
*
* @param KernelInterface $kernel A KernelInterface instance
*/
public function __construct(KernelInterface $kernel)
{
$this->kernel = $kernel;
parent::__construct('Symfony', Kernel::VERSION . ' - ' . $kernel->getName() . '/' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : ''));
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
}
示例8: __construct
/**
* Application constructor.
*/
public function __construct()
{
$this->output = new ConsoleOutput();
$this->output->setTerminalDimensions($this->getTerminalDimensions());
$this->loadConfig();
parent::__construct('Kite');
}
示例9: __construct
/**
* @param Environment $environment
* @param string $name
* @param string $version
*/
public function __construct(Environment $environment, $name, $version)
{
$this->environment = $environment;
$this->validateConfiguration();
$this->environment->getEventEmitter()->emit('peridot.start', $this->environment, $this);
parent::__construct($name, $version);
}
示例10: __construct
/**
* Constructor - name and version inherited from SessionApplication
*
* {@inheritDoc}
*/
public function __construct($container)
{
parent::__construct(PhpcrShell::APP_NAME, PhpcrShell::APP_VERSION);
$this->dispatcher = $container->get('event.dispatcher') ?: new EventDispatcher();
$this->setDispatcher($this->dispatcher);
$this->container = $container;
}
示例11: __construct
/**
* Constructor.
*/
public function __construct()
{
error_reporting(-1);
parent::__construct('Madda', self::VERSION);
$this->add(new CheckSecurityCommand());
$this->add(new GenerateModelCommand());
}
示例12: __construct
/**
* {@inheritdoc}
*/
public function __construct($version)
{
parent::__construct('PHPSpec2', $version);
$dispatcher = new EventDispatcher();
$this->add(new Command\RunCommand($dispatcher));
$this->add(new Command\DescribeCommand($dispatcher));
}
示例13: __construct
public function __construct()
{
parent::__construct('Scaffold', '0.1.0');
$scaffold = new Scaffold();
$container = $scaffold->getContainer();
$this->addCommands(array(new ExecuteCommand('execute', $container), new ListVariablesCommand('vars', $container)));
}
示例14: __construct
/**
* @param Environment $environment
*/
public function __construct(Environment $environment)
{
$this->environment = $environment;
$this->validateConfiguration();
$this->environment->getEventEmitter()->emit('peridot.start', [$this->environment, $this]);
parent::__construct(Version::NAME, Version::NUMBER);
}
示例15: __construct
public function __construct()
{
$version = new Version('2.0.1', dirname(dirname(__DIR__)));
parent::__construct('phpunit-skelgen', $version->getVersion());
$this->add(new GenerateClassCommand());
$this->add(new GenerateTestCommand());
}