当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::__construct方法代码示例

本文整理汇总了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));
 }
开发者ID:Symplify,项目名称:CodingStandard,代码行数:10,代码来源:Application.php

示例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');
 }
开发者ID:JamesForks,项目名称:climb,代码行数:12,代码来源:Application.php

示例3: __construct

 /**
  * Instantiate the class
  *
  */
 public function __construct($appName, $appVersion)
 {
     parent::__construct($appName, $appVersion);
     foreach ($this->commands as $command) {
         $this->add(new $command());
     }
 }
开发者ID:lavary,项目名称:crunz,代码行数:11,代码来源:CommandKernel.php

示例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);
     }
 }
开发者ID:liip,项目名称:rmt,代码行数:30,代码来源:Application.php

示例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);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:30,代码来源:Cli.php

示例6: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     error_reporting(-1);
     parent::__construct('PHP Speller', PhpSpeller::VERSION);
     $this->add(new CheckCommand());
     $this->add(new InfoCommand());
 }
开发者ID:amaxlab,项目名称:speller,代码行数:10,代码来源:Application.php

示例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.'));
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:12,代码来源:Application.php

示例8: __construct

 /**
  * Application constructor.
  */
 public function __construct()
 {
     $this->output = new ConsoleOutput();
     $this->output->setTerminalDimensions($this->getTerminalDimensions());
     $this->loadConfig();
     parent::__construct('Kite');
 }
开发者ID:netresearch,项目名称:kite,代码行数:10,代码来源:Application.php

示例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);
 }
开发者ID:peridot-php,项目名称:peridot-cli,代码行数:12,代码来源:Application.php

示例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;
 }
开发者ID:hason,项目名称:phpcr-shell,代码行数:12,代码来源:ShellApplication.php

示例11: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     error_reporting(-1);
     parent::__construct('Madda', self::VERSION);
     $this->add(new CheckSecurityCommand());
     $this->add(new GenerateModelCommand());
 }
开发者ID:yoghi,项目名称:madda,代码行数:10,代码来源:Application.php

示例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));
 }
开发者ID:phpspec,项目名称:phpspec2,代码行数:10,代码来源:Application.php

示例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)));
 }
开发者ID:czogori,项目名称:scaffold,代码行数:7,代码来源:ScaffoldApplication.php

示例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);
 }
开发者ID:austinsmorris,项目名称:peridot,代码行数:10,代码来源:Application.php

示例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());
 }
开发者ID:msartor,项目名称:phpunit-skeleton-generator,代码行数:7,代码来源:Application.php


注:本文中的Symfony\Component\Console\Application::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。