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


PHP ArgvInput::__construct方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Input\ArgvInput::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ArgvInput::__construct方法的具体用法?PHP ArgvInput::__construct怎么用?PHP ArgvInput::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Input\ArgvInput的用法示例。


在下文中一共展示了ArgvInput::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $argv = $_SERVER['argv'];
     // auto insert a blank command name
     array_splice($argv, 1, 0, '');
     parent::__construct($argv);
 }
开发者ID:mattketmo,项目名称:yamldiff,代码行数:7,代码来源:ArgvInput.php

示例2: __construct

 public function __construct(array $argv = null)
 {
     if (null === $argv) {
         $argv = $_SERVER['argv'];
     }
     $argv = $this->extractRawArgs($argv);
     parent::__construct($argv);
 }
开发者ID:iamluc,项目名称:buse,代码行数:8,代码来源:RawArgvInput.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param array $argv An array of parameters from the CLI (in the argv format)
  */
 public function __construct(array $argv = null)
 {
     parent::__construct($argv, null);
     // Strip the first argument if it is a directory because it will then be the pyrus directory
     if (isset($this->tokens[0]) && @is_dir($this->tokens[0])) {
         $this->registryPath = $this->tokens[0];
         array_shift($this->tokens);
     }
 }
开发者ID:rosstuck,项目名称:Pok,代码行数:14,代码来源:ArgvInput.php

示例4: __construct

 /**
  * Constructor.
  *
  * The constructor has been overridden to check whether the first element in
  * the argument list is an argument (as it represents the command name).
  *
  * If it is not then we insert the command name: *project:run*.
  *
  * This way we can ensure that if no command name is given that the project
  * defaults to the execution of phpDocumentor. This is behavior that is
  * expected from previous releases of phpDocumentor.
  *
  * @param string[]        $argv       An array of parameters from the CLI (in the argv format)
  * @param InputDefinition $definition A InputDefinition instance
  *
  * @api
  */
 public function __construct(array $argv = null, InputDefinition $definition = null)
 {
     if (null === $argv) {
         $argv = $_SERVER['argv'];
     }
     if (count($argv) === 1 || $argv[1][0] === '-') {
         array_splice($argv, 1, 0, 'project:run');
     }
     parent::__construct($argv, $definition);
 }
开发者ID:crazycodr,项目名称:phpDocumentor2,代码行数:27,代码来源:ArgvInput.php

示例5: __construct

 /**
  * Constructor
  *
  * @param Request $request
  * @param InputDefinition $definition
  */
 public function __construct(Request $request, InputDefinition $definition = null)
 {
     $parameters = array(null);
     foreach ($request->getParams() as $key => $param) {
         if (is_numeric($key)) {
             $parameters[] = $param;
         }
     }
     parent::__construct($parameters, $definition);
 }
开发者ID:alex-oleshkevich,项目名称:zf-extras,代码行数:16,代码来源:RequestInput.php

示例6: __construct

 /**
  * Constructor.
  *
  * @since 1.0.0
  *
  * @access public
  * @global array $argv Global array of console arguments passed to script.
  * @param array $args An array of parameters from the CLI (in the argv format).
  * @param \Symfony\Component\Console\Input\InputDefinition $definition Input definition instance.
  */
 public function __construct(array $args = null, InputDefinition $definition = null)
 {
     global $argv;
     if (is_null($args)) {
         $args = array_slice((array) $argv, 1);
         $args = array_filter($args, array($this, 'filter_arguments'));
         $args = array_values($args);
     }
     parent::__construct($args, $definition);
 }
开发者ID:gedex,项目名称:wp-codeception,代码行数:20,代码来源:ArgvInput.php

示例7: __construct

 /**
  * Constructor.
  *
  * @param array           $argv       An array of parameters from the CLI (in the argv format)
  * @param InputDefinition $definition A InputDefinition instance
  */
 public function __construct(array $argv = null, InputDefinition $definition = null)
 {
     if (null === $argv) {
         $argv = $_SERVER['argv'];
     }
     $this->argv = $argv;
     // strip the application name
     array_shift($this->argv);
     parent::__construct($argv, $definition);
 }
开发者ID:loduis,项目名称:artisan,代码行数:16,代码来源:ArgvInput.php

示例8: __construct

 /**
  * Construct a new bound argv input.
  *
  * @param array<integer,string>      $boundArguments The bound arguments.
  * @param array<integer,string>|null $argv           The argv values.
  * @param InputDefinition|null       $definition     The input definition.
  *
  * @throws Exception\UndefinedArgvException If argv information cannot be determined.
  */
 public function __construct(array $boundArguments, array $argv = null, InputDefinition $definition = null)
 {
     if (null === $argv) {
         if (!array_key_exists('argv', $_SERVER)) {
             throw new Exception\UndefinedArgvException();
         }
         $argv = $_SERVER['argv'];
     }
     array_splice($argv, 1, 0, $boundArguments);
     parent::__construct($argv, $definition);
 }
开发者ID:eloquent,项目名称:dumpling,代码行数:20,代码来源:BoundArgvInput.php

示例9: __construct

 /**
  * Constructor.
  *
  * @param string          $input      An array of parameters from the CLI (in the argv format)
  * @param InputDefinition $definition A InputDefinition instance
  *
  * @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead
  */
 public function __construct($input, InputDefinition $definition = null)
 {
     if ($definition) {
         @trigger_error('The $definition argument of the ' . __METHOD__ . ' method is deprecated and will be removed in 3.0. Set this parameter with the bind() method instead.', E_USER_DEPRECATED);
     }
     parent::__construct(array(), null);
     $this->setTokens($this->tokenize($input));
     if (null !== $definition) {
         $this->bind($definition);
     }
 }
开发者ID:Kyra2778,项目名称:AMR,代码行数:19,代码来源:StringInput.php

示例10: __construct

 public function __construct(array $argv = null, InputDefinition $definition = null)
 {
     if (null === $argv) {
         $argv = $_SERVER['argv'];
     }
     array_shift($argv);
     $this->tokens = $argv;
     $this->getTemplateName();
     $this->initializeTemplatePath();
     parent::__construct($definition);
 }
开发者ID:newup,项目名称:core,代码行数:11,代码来源:GeneratorInput.php

示例11: __construct

 public function __construct(InputDefinition $definition = null)
 {
     $parameters = [$_SERVER['argv'][0], 'run'];
     if (isset($_SERVER['argv'][1])) {
         $filename = $this->normalizePath($_SERVER['argv'][1]);
         $cwd = $this->normalizePath(getcwd()) . '/';
         // IDE always provides absolute path but Codeception only accepts relative path without leading "./".
         // If path is not absolute, make it that way and call realpath to remove "./".
         if (strpos($filename, $cwd) !== 0 && file_exists($cwd . $filename)) {
             $filename = $this->normalizePath(realpath($cwd . $filename));
         }
         if (!file_exists($filename)) {
             echo 'File "' . $filename . '" could not be found.';
             exit;
         }
         // Cut of the absolute part for Codeception.
         $parameters[] = substr($filename, strlen($cwd));
     }
     parent::__construct($parameters, $definition);
 }
开发者ID:Northys,项目名称:Codeception,代码行数:20,代码来源:RunTestInput.php

示例12: __construct

 /**
  * Constructor.
  *
  * @param string $input An array of parameters from the CLI (in the argv format)
  */
 public function __construct($input)
 {
     parent::__construct(array());
     $this->setTokens($this->tokenize($input));
 }
开发者ID:saj696,项目名称:pipe,代码行数:10,代码来源:StringInput.php

示例13: __construct

 /**
  * Creates a new parser.
  */
 public function __construct()
 {
     // Hide the parent arguments from the public signature
     parent::__construct();
 }
开发者ID:webmozart,项目名称:console,代码行数:8,代码来源:DefaultArgsParser.php


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