public function __construct() { $argv = $_SERVER['argv']; // auto insert a blank command name array_splice($argv, 1, 0, ''); parent::__construct($argv); }
public function __construct(array $argv = null) { if (null === $argv) { $argv = $_SERVER['argv']; } $argv = $this->extractRawArgs($argv); parent::__construct($argv); }
/** * 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); } }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); } }
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); }
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); }
/** * 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)); }
/** * Creates a new parser. */ public function __construct() { // Hide the parent arguments from the public signature parent::__construct(); }