default services conflit ?
This commit is contained in:
6
old.vendor/pear/console_getopt/.gitignore
vendored
Normal file
6
old.vendor/pear/console_getopt/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# composer related
|
||||
composer.lock
|
||||
composer.phar
|
||||
vendor
|
||||
README.html
|
||||
dist/
|
||||
9
old.vendor/pear/console_getopt/.travis.yml
Normal file
9
old.vendor/pear/console_getopt/.travis.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
language: php
|
||||
php:
|
||||
- 7
|
||||
- 5.6
|
||||
- 5.5
|
||||
- 5.4
|
||||
sudo: false
|
||||
script:
|
||||
- pear run-tests -r tests/
|
||||
365
old.vendor/pear/console_getopt/Console/Getopt.php
Normal file
365
old.vendor/pear/console_getopt/Console/Getopt.php
Normal file
@@ -0,0 +1,365 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||
/**
|
||||
* PHP Version 5
|
||||
*
|
||||
* Copyright (c) 2001-2015, The PEAR developers
|
||||
*
|
||||
* This source file is subject to the BSD-2-Clause license,
|
||||
* that is bundled with this package in the file LICENSE, and is
|
||||
* available through the world-wide-web at the following url:
|
||||
* http://opensource.org/licenses/bsd-license.php.
|
||||
*
|
||||
* @category Console
|
||||
* @package Console_Getopt
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause
|
||||
* @version CVS: $Id$
|
||||
* @link http://pear.php.net/package/Console_Getopt
|
||||
*/
|
||||
|
||||
require_once 'PEAR.php';
|
||||
|
||||
/**
|
||||
* Command-line options parsing class.
|
||||
*
|
||||
* @category Console
|
||||
* @package Console_Getopt
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause
|
||||
* @link http://pear.php.net/package/Console_Getopt
|
||||
*/
|
||||
class Console_Getopt
|
||||
{
|
||||
|
||||
/**
|
||||
* Parses the command-line options.
|
||||
*
|
||||
* The first parameter to this function should be the list of command-line
|
||||
* arguments without the leading reference to the running program.
|
||||
*
|
||||
* The second parameter is a string of allowed short options. Each of the
|
||||
* option letters can be followed by a colon ':' to specify that the option
|
||||
* requires an argument, or a double colon '::' to specify that the option
|
||||
* takes an optional argument.
|
||||
*
|
||||
* The third argument is an optional array of allowed long options. The
|
||||
* leading '--' should not be included in the option name. Options that
|
||||
* require an argument should be followed by '=', and options that take an
|
||||
* option argument should be followed by '=='.
|
||||
*
|
||||
* The return value is an array of two elements: the list of parsed
|
||||
* options and the list of non-option command-line arguments. Each entry in
|
||||
* the list of parsed options is a pair of elements - the first one
|
||||
* specifies the option, and the second one specifies the option argument,
|
||||
* if there was one.
|
||||
*
|
||||
* Long and short options can be mixed.
|
||||
*
|
||||
* Most of the semantics of this function are based on GNU getopt_long().
|
||||
*
|
||||
* @param array $args an array of command-line arguments
|
||||
* @param string $short_options specifies the list of allowed short options
|
||||
* @param array $long_options specifies the list of allowed long options
|
||||
* @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option
|
||||
*
|
||||
* @return array two-element array containing the list of parsed options and
|
||||
* the non-option arguments
|
||||
*/
|
||||
public static function getopt2($args, $short_options, $long_options = null, $skip_unknown = false)
|
||||
{
|
||||
return Console_Getopt::doGetopt(2, $args, $short_options, $long_options, $skip_unknown);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function expects $args to start with the script name (POSIX-style).
|
||||
* Preserved for backwards compatibility.
|
||||
*
|
||||
* @param array $args an array of command-line arguments
|
||||
* @param string $short_options specifies the list of allowed short options
|
||||
* @param array $long_options specifies the list of allowed long options
|
||||
*
|
||||
* @see getopt2()
|
||||
* @return array two-element array containing the list of parsed options and
|
||||
* the non-option arguments
|
||||
*/
|
||||
public static function getopt($args, $short_options, $long_options = null, $skip_unknown = false)
|
||||
{
|
||||
return Console_Getopt::doGetopt(1, $args, $short_options, $long_options, $skip_unknown);
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual implementation of the argument parsing code.
|
||||
*
|
||||
* @param int $version Version to use
|
||||
* @param array $args an array of command-line arguments
|
||||
* @param string $short_options specifies the list of allowed short options
|
||||
* @param array $long_options specifies the list of allowed long options
|
||||
* @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
|
||||
{
|
||||
// in case you pass directly readPHPArgv() as the first arg
|
||||
if (PEAR::isError($args)) {
|
||||
return $args;
|
||||
}
|
||||
|
||||
if (empty($args)) {
|
||||
return array(array(), array());
|
||||
}
|
||||
|
||||
$non_opts = $opts = array();
|
||||
|
||||
settype($args, 'array');
|
||||
|
||||
if ($long_options) {
|
||||
sort($long_options);
|
||||
}
|
||||
|
||||
/*
|
||||
* Preserve backwards compatibility with callers that relied on
|
||||
* erroneous POSIX fix.
|
||||
*/
|
||||
if ($version < 2) {
|
||||
if (isset($args[0][0]) && $args[0][0] != '-') {
|
||||
array_shift($args);
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($args); $i++) {
|
||||
$arg = $args[$i];
|
||||
/* The special element '--' means explicit end of
|
||||
options. Treat the rest of the arguments as non-options
|
||||
and end the loop. */
|
||||
if ($arg == '--') {
|
||||
$non_opts = array_merge($non_opts, array_slice($args, $i + 1));
|
||||
break;
|
||||
}
|
||||
|
||||
if ($arg[0] != '-' || (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) {
|
||||
$non_opts = array_merge($non_opts, array_slice($args, $i));
|
||||
break;
|
||||
} elseif (strlen($arg) > 1 && $arg[1] == '-') {
|
||||
$error = Console_Getopt::_parseLongOption(substr($arg, 2),
|
||||
$long_options,
|
||||
$opts,
|
||||
$i,
|
||||
$args,
|
||||
$skip_unknown);
|
||||
if (PEAR::isError($error)) {
|
||||
return $error;
|
||||
}
|
||||
} elseif ($arg == '-') {
|
||||
// - is stdin
|
||||
$non_opts = array_merge($non_opts, array_slice($args, $i));
|
||||
break;
|
||||
} else {
|
||||
$error = Console_Getopt::_parseShortOption(substr($arg, 1),
|
||||
$short_options,
|
||||
$opts,
|
||||
$i,
|
||||
$args,
|
||||
$skip_unknown);
|
||||
if (PEAR::isError($error)) {
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array($opts, $non_opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse short option
|
||||
*
|
||||
* @param string $arg Argument
|
||||
* @param string[] $short_options Available short options
|
||||
* @param string[][] &$opts
|
||||
* @param int &$argIdx
|
||||
* @param string[] $args
|
||||
* @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
|
||||
{
|
||||
for ($i = 0; $i < strlen($arg); $i++) {
|
||||
$opt = $arg[$i];
|
||||
$opt_arg = null;
|
||||
|
||||
/* Try to find the short option in the specifier string. */
|
||||
if (($spec = strstr($short_options, $opt)) === false || $arg[$i] == ':') {
|
||||
if ($skip_unknown === true) {
|
||||
break;
|
||||
}
|
||||
|
||||
$msg = "Console_Getopt: unrecognized option -- $opt";
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
|
||||
if (strlen($spec) > 1 && $spec[1] == ':') {
|
||||
if (strlen($spec) > 2 && $spec[2] == ':') {
|
||||
if ($i + 1 < strlen($arg)) {
|
||||
/* Option takes an optional argument. Use the remainder of
|
||||
the arg string if there is anything left. */
|
||||
$opts[] = array($opt, substr($arg, $i + 1));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Option requires an argument. Use the remainder of the arg
|
||||
string if there is anything left. */
|
||||
if ($i + 1 < strlen($arg)) {
|
||||
$opts[] = array($opt, substr($arg, $i + 1));
|
||||
break;
|
||||
} else if (isset($args[++$argIdx])) {
|
||||
$opt_arg = $args[$argIdx];
|
||||
/* Else use the next argument. */;
|
||||
if (Console_Getopt::_isShortOpt($opt_arg)
|
||||
|| Console_Getopt::_isLongOpt($opt_arg)) {
|
||||
$msg = "option requires an argument --$opt";
|
||||
return PEAR::raiseError("Console_Getopt: " . $msg);
|
||||
}
|
||||
} else {
|
||||
$msg = "option requires an argument --$opt";
|
||||
return PEAR::raiseError("Console_Getopt: " . $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$opts[] = array($opt, $opt_arg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an argument is a short option
|
||||
*
|
||||
* @param string $arg Argument to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function _isShortOpt($arg)
|
||||
{
|
||||
return strlen($arg) == 2 && $arg[0] == '-'
|
||||
&& preg_match('/[a-zA-Z]/', $arg[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an argument is a long option
|
||||
*
|
||||
* @param string $arg Argument to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function _isLongOpt($arg)
|
||||
{
|
||||
return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
|
||||
preg_match('/[a-zA-Z]+$/', substr($arg, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse long option
|
||||
*
|
||||
* @param string $arg Argument
|
||||
* @param string[] $long_options Available long options
|
||||
* @param string[][] &$opts
|
||||
* @param int &$argIdx
|
||||
* @param string[] $args
|
||||
*
|
||||
* @return void|PEAR_Error
|
||||
*/
|
||||
protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
|
||||
{
|
||||
@list($opt, $opt_arg) = explode('=', $arg, 2);
|
||||
|
||||
$opt_len = strlen($opt);
|
||||
|
||||
for ($i = 0; $i < count($long_options); $i++) {
|
||||
$long_opt = $long_options[$i];
|
||||
$opt_start = substr($long_opt, 0, $opt_len);
|
||||
|
||||
$long_opt_name = str_replace('=', '', $long_opt);
|
||||
|
||||
/* Option doesn't match. Go on to the next one. */
|
||||
if ($long_opt_name != $opt) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$opt_rest = substr($long_opt, $opt_len);
|
||||
|
||||
/* Check that the options uniquely matches one of the allowed
|
||||
options. */
|
||||
if ($i + 1 < count($long_options)) {
|
||||
$next_option_rest = substr($long_options[$i + 1], $opt_len);
|
||||
} else {
|
||||
$next_option_rest = '';
|
||||
}
|
||||
|
||||
if ($opt_rest != '' && $opt[0] != '=' &&
|
||||
$i + 1 < count($long_options) &&
|
||||
$opt == substr($long_options[$i+1], 0, $opt_len) &&
|
||||
$next_option_rest != '' &&
|
||||
$next_option_rest[0] != '=') {
|
||||
|
||||
$msg = "Console_Getopt: option --$opt is ambiguous";
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
|
||||
if (substr($long_opt, -1) == '=') {
|
||||
if (substr($long_opt, -2) != '==') {
|
||||
/* Long option requires an argument.
|
||||
Take the next argument if one wasn't specified. */;
|
||||
if (!strlen($opt_arg)) {
|
||||
if (!isset($args[++$argIdx])) {
|
||||
$msg = "Console_Getopt: option requires an argument --$opt";
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
$opt_arg = $args[$argIdx];
|
||||
}
|
||||
|
||||
if (Console_Getopt::_isShortOpt($opt_arg)
|
||||
|| Console_Getopt::_isLongOpt($opt_arg)) {
|
||||
$msg = "Console_Getopt: option requires an argument --$opt";
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
}
|
||||
} else if ($opt_arg) {
|
||||
$msg = "Console_Getopt: option --$opt doesn't allow an argument";
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
|
||||
$opts[] = array('--' . $opt, $opt_arg);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($skip_unknown === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
return PEAR::raiseError("Console_Getopt: unrecognized option --$opt");
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely read the $argv PHP array across different PHP configurations.
|
||||
* Will take care on register_globals and register_argc_argv ini directives
|
||||
*
|
||||
* @return mixed the $argv PHP array or PEAR error if not registered
|
||||
*/
|
||||
public static function readPHPArgv()
|
||||
{
|
||||
global $argv;
|
||||
if (!is_array($argv)) {
|
||||
if (!@is_array($_SERVER['argv'])) {
|
||||
if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
|
||||
$msg = "Could not read cmd args (register_argc_argv=Off?)";
|
||||
return PEAR::raiseError("Console_Getopt: " . $msg);
|
||||
}
|
||||
return $GLOBALS['HTTP_SERVER_VARS']['argv'];
|
||||
}
|
||||
return $_SERVER['argv'];
|
||||
}
|
||||
return $argv;
|
||||
}
|
||||
|
||||
}
|
||||
25
old.vendor/pear/console_getopt/LICENSE
Normal file
25
old.vendor/pear/console_getopt/LICENSE
Normal file
@@ -0,0 +1,25 @@
|
||||
Copyright (c) 2001-2015, The PEAR developers
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
26
old.vendor/pear/console_getopt/README.rst
Normal file
26
old.vendor/pear/console_getopt/README.rst
Normal file
@@ -0,0 +1,26 @@
|
||||
*******************************************
|
||||
Console_Getopt - Command-line option parser
|
||||
*******************************************
|
||||
|
||||
This is a PHP implementation of "getopt" supporting both short and long options.
|
||||
It helps parsing command line options in your PHP script.
|
||||
|
||||
Homepage: http://pear.php.net/package/Console_Getopt
|
||||
|
||||
.. image:: https://travis-ci.org/pear/Console_Getopt.svg?branch=master
|
||||
:target: https://travis-ci.org/pear/Console_Getopt
|
||||
|
||||
|
||||
Alternatives
|
||||
============
|
||||
|
||||
* Console_CommandLine__ (recommended)
|
||||
* Console_GetoptPlus__
|
||||
|
||||
__ http://pear.php.net/package/Console_CommandLine
|
||||
__ http://pear.php.net/package/Console_GetoptPlus
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
BSD-2-Clause
|
||||
35
old.vendor/pear/console_getopt/composer.json
Normal file
35
old.vendor/pear/console_getopt/composer.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "andrei@php.net",
|
||||
"name": "Andrei Zmievski",
|
||||
"role": "Lead"
|
||||
},
|
||||
{
|
||||
"email": "stig@php.net",
|
||||
"name": "Stig Bakken",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"email": "cellog@php.net",
|
||||
"name": "Greg Beaver",
|
||||
"role": "Helper"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Console": "./"
|
||||
}
|
||||
},
|
||||
"description": "More info available on: http://pear.php.net/package/Console_Getopt",
|
||||
"include-path": [
|
||||
"./"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"name": "pear/console_getopt",
|
||||
"support": {
|
||||
"issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Console_Getopt",
|
||||
"source": "https://github.com/pear/Console_Getopt"
|
||||
},
|
||||
"type": "library"
|
||||
}
|
||||
302
old.vendor/pear/console_getopt/package.xml
Normal file
302
old.vendor/pear/console_getopt/package.xml
Normal file
@@ -0,0 +1,302 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<package packagerversion="1.9.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>Console_Getopt</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<summary>Command-line option parser</summary>
|
||||
<description>This is a PHP implementation of "getopt" supporting both
|
||||
short and long options.</description>
|
||||
<lead>
|
||||
<name>Andrei Zmievski</name>
|
||||
<user>andrei</user>
|
||||
<email>andrei@php.net</email>
|
||||
<active>no</active>
|
||||
</lead>
|
||||
<developer>
|
||||
<name>Stig Bakken</name>
|
||||
<user>ssb</user>
|
||||
<email>stig@php.net</email>
|
||||
<active>no</active>
|
||||
</developer>
|
||||
<helper>
|
||||
<name>Greg Beaver</name>
|
||||
<user>cellog</user>
|
||||
<email>cellog@php.net</email>
|
||||
<active>no</active>
|
||||
</helper>
|
||||
|
||||
<date>2019-11-20</date>
|
||||
<version>
|
||||
<release>1.4.3</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
|
||||
<notes>
|
||||
* PR #4: Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
* PR #5: fix phplint warnings
|
||||
</notes>
|
||||
|
||||
<contents>
|
||||
<dir name="/">
|
||||
<dir name="Console">
|
||||
<file name="Getopt.php" role="php" />
|
||||
</dir>
|
||||
<dir name="tests">
|
||||
<file role="test" name="001-getopt.phpt" />
|
||||
<file role="test" name="bug10557.phpt" />
|
||||
<file role="test" name="bug11068.phpt" />
|
||||
<file role="test" name="bug13140.phpt" />
|
||||
</dir>
|
||||
</dir>
|
||||
</contents>
|
||||
|
||||
<compatible>
|
||||
<name>PEAR</name>
|
||||
<channel>pear.php.net</channel>
|
||||
<min>1.4.0</min>
|
||||
<max>1.999.999</max>
|
||||
</compatible>
|
||||
|
||||
<dependencies>
|
||||
<required>
|
||||
<php>
|
||||
<min>5.4.0</min>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.8.0</min>
|
||||
</pearinstaller>
|
||||
</required>
|
||||
</dependencies>
|
||||
|
||||
<phprelease />
|
||||
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<date>2019-11-20</date>
|
||||
<version>
|
||||
<release>1.4.3</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
<notes>
|
||||
* PR #4: Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
* PR #5: fix phplint warnings
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2019-02-06</date>
|
||||
<version>
|
||||
<release>1.4.2</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
<notes>
|
||||
* Remove use of each(), which is removed in PHP 8
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2015-07-20</date>
|
||||
<version>
|
||||
<release>1.4.1</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
<notes>
|
||||
* Fix unit test on PHP 7 [cweiske]
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2015-02-22</date>
|
||||
<version>
|
||||
<release>1.4.0</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
<notes>
|
||||
* Change license to BSD-2-Clause
|
||||
* Set minimum PHP version to 5.4.0
|
||||
* Mark static methods with "static" keyword
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2011-03-07</date>
|
||||
<version>
|
||||
<release>1.3.1</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
* Change the minimum PEAR installer dep to be lower
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2010-12-11</date>
|
||||
<time>20:20:13</time>
|
||||
<version>
|
||||
<release>1.3.0</release>
|
||||
<api>1.3.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
* Implement Request #13140: [PATCH] to skip unknown parameters. [patch by rquadling, improved on by dufuz]
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2007-06-12</date>
|
||||
<version>
|
||||
<release>1.2.3</release>
|
||||
<api>1.2.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
* fix Bug #11068: No way to read plain "-" option [cardoe]
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.2.2</release>
|
||||
<api>1.2.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2007-02-17</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
* fix Bug #4475: An ambiguous error occurred when specifying similar longoption name.
|
||||
* fix Bug #10055: Not failing properly on short options missing required values
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.2.1</release>
|
||||
<api>1.2.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2006-12-08</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Fixed bugs #4448 (Long parameter values truncated with longoption parameter) and #7444 (Trailing spaces after php closing tag)
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.2</release>
|
||||
<api>1.2</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2003-12-11</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Fix to preserve BC with 1.0 and allow correct behaviour for new users
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>1.0</release>
|
||||
<api>1.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2002-09-13</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Stable release
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.11</release>
|
||||
<api>0.11</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2002-05-26</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
POSIX getopt compatibility fix: treat first element of args
|
||||
array as command name
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.10</release>
|
||||
<api>0.10</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2002-05-12</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Packaging fix
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>0.9</release>
|
||||
<api>0.9</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2002-05-12</date>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Initial release
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
63
old.vendor/pear/console_getopt/tests/001-getopt.phpt
Normal file
63
old.vendor/pear/console_getopt/tests/001-getopt.phpt
Normal file
@@ -0,0 +1,63 @@
|
||||
--TEST--
|
||||
Console_Getopt
|
||||
--FILE--
|
||||
<?php
|
||||
require_once 'Console/Getopt.php';
|
||||
PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s\n\n");
|
||||
|
||||
function test($argstr, $optstr) {
|
||||
$argv = preg_split('/[[:space:]]+/', $argstr);
|
||||
if (PEAR::isError($options = Console_Getopt::getopt($argv, $optstr))) {
|
||||
return;
|
||||
}
|
||||
$opts = $options[0];
|
||||
$non_opts = $options[1];
|
||||
$i = 0;
|
||||
print "options: ";
|
||||
foreach ($opts as $o => $d) {
|
||||
if ($i++ > 0) {
|
||||
print ", ";
|
||||
}
|
||||
print $d[0] . '=' . $d[1];
|
||||
}
|
||||
print "\n";
|
||||
print "params: " . implode(", ", $non_opts) . "\n";
|
||||
print "\n";
|
||||
}
|
||||
|
||||
test("-abc", "abc");
|
||||
test("-abc foo", "abc");
|
||||
test("-abc foo", "abc:");
|
||||
test("-abc foo bar gazonk", "abc");
|
||||
test("-abc foo bar gazonk", "abc:");
|
||||
test("-a -b -c", "abc");
|
||||
test("-a -b -c", "abc:");
|
||||
test("-abc", "ab:c");
|
||||
test("-abc foo -bar gazonk", "abc");
|
||||
?>
|
||||
--EXPECT--
|
||||
options: a=, b=, c=
|
||||
params:
|
||||
|
||||
options: a=, b=, c=
|
||||
params: foo
|
||||
|
||||
options: a=, b=, c=foo
|
||||
params:
|
||||
|
||||
options: a=, b=, c=
|
||||
params: foo, bar, gazonk
|
||||
|
||||
options: a=, b=, c=foo
|
||||
params: bar, gazonk
|
||||
|
||||
options: a=, b=, c=
|
||||
params:
|
||||
|
||||
Console_Getopt: option requires an argument --c
|
||||
|
||||
options: a=, b=c
|
||||
params:
|
||||
|
||||
options: a=, b=, c=
|
||||
params: foo, -bar, gazonk
|
||||
22
old.vendor/pear/console_getopt/tests/bug10557.phpt
Normal file
22
old.vendor/pear/console_getopt/tests/bug10557.phpt
Normal file
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Console_Getopt [bug 10557]
|
||||
--SKIPIF--
|
||||
--FILE--
|
||||
<?php
|
||||
$_SERVER['argv'] =
|
||||
$argv = array('hi', '-fjjohnston@mail.com', '--to', '--mailpack', '--debug');
|
||||
require_once 'Console/Getopt.php';
|
||||
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'f:t:',
|
||||
array('from=','to=','mailpack=','direction=','verbose','debug'));
|
||||
if(PEAR::isError($ret))
|
||||
{
|
||||
echo $ret->getMessage()."\n";
|
||||
echo 'FATAL';
|
||||
exit;
|
||||
}
|
||||
|
||||
print_r($ret);
|
||||
?>
|
||||
--EXPECT--
|
||||
Console_Getopt: option requires an argument --to
|
||||
FATAL
|
||||
44
old.vendor/pear/console_getopt/tests/bug11068.phpt
Normal file
44
old.vendor/pear/console_getopt/tests/bug11068.phpt
Normal file
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Console_Getopt [bug 11068]
|
||||
--SKIPIF--
|
||||
--FILE--
|
||||
<?php
|
||||
$_SERVER['argv'] =
|
||||
$argv = array('hi', '-fjjohnston@mail.com', '--to', 'hi', '-');
|
||||
require_once 'Console/Getopt.php';
|
||||
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'f:t:',
|
||||
array('from=','to=','mailpack=','direction=','verbose','debug'));
|
||||
if(PEAR::isError($ret))
|
||||
{
|
||||
echo $ret->getMessage()."\n";
|
||||
echo 'FATAL';
|
||||
exit;
|
||||
}
|
||||
|
||||
print_r($ret);
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => f
|
||||
[1] => jjohnston@mail.com
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => --to
|
||||
[1] => hi
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => -
|
||||
)
|
||||
|
||||
)
|
||||
75
old.vendor/pear/console_getopt/tests/bug13140.phpt
Normal file
75
old.vendor/pear/console_getopt/tests/bug13140.phpt
Normal file
@@ -0,0 +1,75 @@
|
||||
--TEST--
|
||||
Console_Getopt [bug 13140]
|
||||
--SKIPIF--
|
||||
--FILE--
|
||||
<?php
|
||||
$_SERVER['argv'] = $argv =
|
||||
array('--bob', '--foo' , '-bar', '--test', '-rq', 'thisshouldbehere');
|
||||
|
||||
require_once 'Console/Getopt.php';
|
||||
$cg = new Console_GetOpt();
|
||||
|
||||
print_r($cg->getopt2($cg->readPHPArgv(), 't', array('test'), true));
|
||||
print_r($cg->getopt2($cg->readPHPArgv(), 'bar', array('foo'), true));
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => --test
|
||||
[1] =>
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => thisshouldbehere
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => --foo
|
||||
[1] =>
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => b
|
||||
[1] =>
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => a
|
||||
[1] =>
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[0] => r
|
||||
[1] =>
|
||||
)
|
||||
|
||||
[4] => Array
|
||||
(
|
||||
[0] => r
|
||||
[1] =>
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => thisshouldbehere
|
||||
)
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user