public __construct ( string $name = 'UNKNOWN', string $version = 'UNKNOWN' ) | ||
$name | string | The name of the application |
$version | string | The version of the application |
/** * {@inheritdoc} */ public function __construct() { parent::__construct('Symplify Coding Standard', null); $runnerCollection = $this->createAndFillRunnerCollection(); $this->add(new CheckCommand($runnerCollection)); $this->add(new FixCommand($runnerCollection)); }
/** * 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'); }
/** * Instantiate the class * */ public function __construct($appName, $appVersion) { parent::__construct($appName, $appVersion); foreach ($this->commands as $command) { $this->add(new $command()); } }
/** * @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); } }
/** * @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); }
/** * Constructor. */ public function __construct() { error_reporting(-1); parent::__construct('PHP Speller', PhpSpeller::VERSION); $this->add(new CheckCommand()); $this->add(new InfoCommand()); }
/** * 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.')); }
/** * Application constructor. */ public function __construct() { $this->output = new ConsoleOutput(); $this->output->setTerminalDimensions($this->getTerminalDimensions()); $this->loadConfig(); parent::__construct('Kite'); }
/** * @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); }
/** * 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; }
/** * Constructor. */ public function __construct() { error_reporting(-1); parent::__construct('Madda', self::VERSION); $this->add(new CheckSecurityCommand()); $this->add(new GenerateModelCommand()); }
/** * {@inheritdoc} */ public function __construct($version) { parent::__construct('PHPSpec2', $version); $dispatcher = new EventDispatcher(); $this->add(new Command\RunCommand($dispatcher)); $this->add(new Command\DescribeCommand($dispatcher)); }
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))); }
/** * @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); }
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()); }
/** * Constructor * * @param ContainerInterface $container The container */ public function __construct(ContainerInterface $container) { parent::__construct('Joomla CLI', '__DEPLOY_VERSION__'); $this->setCatchExceptions(false); $this->container = $container; $this->addPlugins(__DIR__ . '/Command'); }
/** * Scaffold Application constructor. */ public function __construct() { $name = 'Aedart Scaffold Installer'; $version = $this->resolveApplicationVersion(); parent::__construct($name, $version); $this->setupApplication(); }
/** * * @param type $name * @param type $version * @param \Nucleus\IService\Invoker\IInvokerService $invoker * @param \Nucleus\IService\DependencyInjection\IServiceContainer $serviceContainer * @\Nucleus\IService\DependencyInjection\Inject */ public function __construct($name = 'Nucleus', $version = '1.0', IInvokerService $invoker, IServiceContainer $serviceContainer) { // @TODO : get version and name from application Kernel parent::__construct($name, $version); $this->serviceContainer = $serviceContainer; $this->invoker = $invoker; }
/** * @param string $baseProjectDirectory */ public function __construct($baseProjectDirectory) { $this->baseProjectDirectory = $baseProjectDirectory; parent::__construct('PHP CS', self::VERSION); $this->add(new FixCommand()); $this->add(new ReviewCommand()); }
/** * Constructor. */ public function __construct() { error_reporting(-1); parent::__construct('PHP 7 Checker', Parser::VERSION); $this->add(new CheckCommand()); $this->setDefaultCommand('check'); }
public function __construct() { parent::__construct('My Symfony application', 'v1.0'); $this->add(new DescriptorCommand1()); $this->add(new DescriptorCommand2()); $this->add(new DescriptorCommand3()); }
public function __construct(Container $container) { parent::__construct(static::NAME, static::VERSION); foreach ($container['commands'] as $command) { $this->add($container[$command]); } }
public function __construct(SilexApplication $application, $projectDirectory, $name = 'UNKNOWN', $version = 'UNKNOWN') { parent::__construct($name, $version); $this->silexApplication = $application; $this->projectDirectory = $projectDirectory; $application->boot(); }
public function __construct() { $appKernel = new AppKernel('dev', true); $appKernel->boot(); $this->container = $appKernel->getContainer(); parent::__construct('commit-msg'); }
/** * Constructor. * * @param Container $app */ public function __construct(Container $app) { $name = isset($app['console.name']) ? $app['console.name'] : null; $version = isset($app['console.version']) ? $app['console.version'] : null; parent::__construct($name, $version); $this->silexApp = $app; }
/** * @inheritdoc */ public function __construct() { parent::__construct(static::NAME, static::VERSION); $this->add(new Command\ValidateCommand()); $this->add(new Command\GeneratePackageCommand()); $this->add(new Command\UpdateCommand()); }
/** * Create a new application. * * @param $container */ public function __construct($container) { $this->container = $container; parent::__construct($this::NAME, $this::VERSION); $this->env = $this->getConfig()->get('application.environment'); $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_OPTIONAL, $this->trans('application.options.env'), $this->env)); $this->getDefinition()->addOption(new InputOption('--root', null, InputOption::VALUE_OPTIONAL, $this->trans('application.options.root'))); $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, $this->trans('application.options.no-debug'))); $this->getDefinition()->addOption(new InputOption('--learning', null, InputOption::VALUE_NONE, $this->trans('application.options.learning'))); $this->getDefinition()->addOption(new InputOption('--generate-chain', '-c', InputOption::VALUE_NONE, $this->trans('application.options.generate-chain'))); $this->getDefinition()->addOption(new InputOption('--generate-inline', '-i', InputOption::VALUE_NONE, $this->trans('application.options.generate-inline'))); $this->getDefinition()->addOption(new InputOption('--generate-doc', '-d', InputOption::VALUE_NONE, $this->trans('application.options.generate-doc'))); $this->getDefinition()->addOption(new InputOption('--target', '-t', InputOption::VALUE_OPTIONAL, $this->trans('application.options.target'))); $this->getDefinition()->addOption(new InputOption('--uri', '-l', InputOption::VALUE_REQUIRED, $this->trans('application.options.uri'))); $this->getDefinition()->addOption(new InputOption('--yes', '-y', InputOption::VALUE_NONE, $this->trans('application.options.yes'))); $options = $this->getConfig()->get('application.options') ?: []; foreach ($options as $key => $option) { if ($this->getDefinition()->hasOption($key)) { if (is_bool($option) && $option === true) { $_SERVER['argv'][] = sprintf('--%s', $key); } if (!is_bool($option) && $option) { $_SERVER['argv'][] = sprintf('--%s=%s', $key, $option); } } } if (count($_SERVER['argv']) > 1 && stripos($_SERVER['argv'][1], '@') === 0) { $_SERVER['argv'][1] = sprintf('--target=%s', substr($_SERVER['argv'][1], 1)); } }
public function __construct(Config $config, History $history) { parent::__construct('git-s3', '0.1.0'); $this->config = $config; $this->history = $history; $this->addCommands(array(new Commands\ConfigCommand(), new Commands\DeployCommand())); }
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') { parent::__construct($name, $version); $this->add(new Generate()); $this->add(new Serve()); $this->setDefaultCommand('generate'); }
/** * @param Application $kernel * @param string $name * @param string $version */ public function __construct(Application $kernel, $name = 'UNKNOWN', $version = 'UNKNOWN') { parent::__construct($name, $version); $this->kernel = $kernel; $this->container = $this->kernel->getContainer(); $this->initModules(); }