PEAR System.php updated to 1.9.4

This commit is contained in:
Mikael Nordfeldth 2014-03-15 14:01:10 +01:00
parent e9e4190b64
commit 44d292b33b
1 changed files with 12 additions and 4 deletions

View File

@ -9,7 +9,7 @@
* @author Tomas V.V.Cox <cox@idecnet.com> * @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2009 The Authors * @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: System.php 307683 2011-01-23 21:56:12Z dufuz $ * @version CVS: $Id: System.php 313024 2011-07-06 19:51:24Z dufuz $
* @link http://pear.php.net/package/PEAR * @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1 * @since File available since Release 0.1
*/ */
@ -51,7 +51,7 @@ $GLOBALS['_System_temp_files'] = array();
* @author Tomas V.V. Cox <cox@idecnet.com> * @author Tomas V.V. Cox <cox@idecnet.com>
* @copyright 1997-2006 The PHP Group * @copyright 1997-2006 The PHP Group
* @license http://opensource.org/licenses/bsd-license.php New BSD License * @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 1.9.2 * @version Release: 1.9.4
* @link http://pear.php.net/package/PEAR * @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1 * @since Class available since Release 0.1
* @static * @static
@ -71,9 +71,17 @@ class System
function _parseArgs($argv, $short_options, $long_options = null) function _parseArgs($argv, $short_options, $long_options = null)
{ {
if (!is_array($argv) && $argv !== null) { if (!is_array($argv) && $argv !== null) {
$argv = preg_split('/\s+/', $argv, -1, PREG_SPLIT_NO_EMPTY); // Find all items, quoted or otherwise
preg_match_all("/(?:[\"'])(.*?)(?:['\"])|([^\s]+)/", $argv, $av);
$argv = $av[1];
foreach ($av[2] as $k => $a) {
if (empty($a)) {
continue;
}
$argv[$k] = trim($a) ;
}
} }
return Console_Getopt::getopt2($argv, $short_options); return Console_Getopt::getopt2($argv, $short_options, $long_options);
} }
/** /**