OXIESEC PANEL
- Current Dir:
/
/
usr
/
share
/
php
/
Symfony
/
Component
/
Console
/
Input
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📄
ArgvInput.php
10.71 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
ArrayInput.php
5.45 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
Input.php
4.88 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
InputArgument.php
3.25 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
InputAwareInterface.php
606 bytes
03/05/2018 08:02:01 PM
rw-r--r--
📄
InputDefinition.php
11 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
InputInterface.php
4.8 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
InputOption.php
5.78 KB
03/05/2018 08:02:01 PM
rw-r--r--
📄
StreamableInputInterface.php
873 bytes
03/05/2018 08:02:01 PM
rw-r--r--
📄
StringInput.php
2.33 KB
03/05/2018 08:02:01 PM
rw-r--r--
Editing: StringInput.php
Close
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Input; use Symfony\Component\Console\Exception\InvalidArgumentException; /** * StringInput represents an input provided as a string. * * Usage: * * $input = new StringInput('foo --bar="foobar"'); * * @author Fabien Potencier <fabien@symfony.com> */ class StringInput extends ArgvInput { const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)'; const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'; /** * @param string $input A string representing the parameters from the CLI */ public function __construct($input) { parent::__construct(array()); $this->setTokens($this->tokenize($input)); } /** * Tokenizes a string. * * @param string $input The input to tokenize * * @return array An array of tokens * * @throws InvalidArgumentException When unable to parse input (should never happen) */ private function tokenize($input) { $tokens = array(); $length = strlen($input); $cursor = 0; while ($cursor < $length) { if (preg_match('/\s+/A', $input, $match, null, $cursor)) { } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2)); } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { $tokens[] = stripcslashes($match[1]); } else { // should never happen throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); } $cursor += strlen($match[0]); } return $tokens; } }