__construct() публичный метод

public __construct ( string $name = 'UNKNOWN', string $version = 'UNKNOWN' )
$name string The name of the application
$version string The version of the application
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct('Symplify Coding Standard', null);
     $runnerCollection = $this->createAndFillRunnerCollection();
     $this->add(new CheckCommand($runnerCollection));
     $this->add(new FixCommand($runnerCollection));
 }
Пример #2
0
 /**
  * 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
0
 /**
  * Instantiate the class
  *
  */
 public function __construct($appName, $appVersion)
 {
     parent::__construct($appName, $appVersion);
     foreach ($this->commands as $command) {
         $this->add(new $command());
     }
 }
Пример #4
0
 /**
  * @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
0
 /**
  * @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
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     error_reporting(-1);
     parent::__construct('PHP Speller', PhpSpeller::VERSION);
     $this->add(new CheckCommand());
     $this->add(new InfoCommand());
 }
Пример #7
0
 /**
  * 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
0
 /**
  * Application constructor.
  */
 public function __construct()
 {
     $this->output = new ConsoleOutput();
     $this->output->setTerminalDimensions($this->getTerminalDimensions());
     $this->loadConfig();
     parent::__construct('Kite');
 }
Пример #9
0
 /**
  * @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
0
 /**
  * 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
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     error_reporting(-1);
     parent::__construct('Madda', self::VERSION);
     $this->add(new CheckSecurityCommand());
     $this->add(new GenerateModelCommand());
 }
Пример #12
0
 /**
  * {@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
0
 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
0
 /**
  * @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());
 }
Пример #16
0
 /**
  * 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');
 }
Пример #17
0
 /**
  * Scaffold Application constructor.
  */
 public function __construct()
 {
     $name = 'Aedart Scaffold Installer';
     $version = $this->resolveApplicationVersion();
     parent::__construct($name, $version);
     $this->setupApplication();
 }
Пример #18
0
 /**
  * 
  * @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;
 }
Пример #19
0
 /**
  * @param string $baseProjectDirectory
  */
 public function __construct($baseProjectDirectory)
 {
     $this->baseProjectDirectory = $baseProjectDirectory;
     parent::__construct('PHP CS', self::VERSION);
     $this->add(new FixCommand());
     $this->add(new ReviewCommand());
 }
Пример #20
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     error_reporting(-1);
     parent::__construct('PHP 7 Checker', Parser::VERSION);
     $this->add(new CheckCommand());
     $this->setDefaultCommand('check');
 }
Пример #21
0
 public function __construct()
 {
     parent::__construct('My Symfony application', 'v1.0');
     $this->add(new DescriptorCommand1());
     $this->add(new DescriptorCommand2());
     $this->add(new DescriptorCommand3());
 }
Пример #22
0
 public function __construct(Container $container)
 {
     parent::__construct(static::NAME, static::VERSION);
     foreach ($container['commands'] as $command) {
         $this->add($container[$command]);
     }
 }
Пример #23
0
 public function __construct(SilexApplication $application, $projectDirectory, $name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct($name, $version);
     $this->silexApplication = $application;
     $this->projectDirectory = $projectDirectory;
     $application->boot();
 }
Пример #24
0
 public function __construct()
 {
     $appKernel = new AppKernel('dev', true);
     $appKernel->boot();
     $this->container = $appKernel->getContainer();
     parent::__construct('commit-msg');
 }
Пример #25
0
 /**
  * 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;
 }
Пример #26
0
 /**
  * @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());
 }
Пример #27
0
 /**
  * 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));
     }
 }
Пример #28
0
 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()));
 }
Пример #29
0
 public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct($name, $version);
     $this->add(new Generate());
     $this->add(new Serve());
     $this->setDefaultCommand('generate');
 }
Пример #30
0
 /**
  * @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();
 }