X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fpear%2FSystem.php;h=9ff3fedb9463544808b825525008a4318bd455da;hb=75a1eedb8977b8f2db459128bab9aaf367e3b58b;hp=c27d44658e3eed375e5e3763b753fe2024b2235f;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/lib/pear/System.php b/WEB-INF/lib/pear/System.php index c27d4465..9ff3fedb 100644 --- a/WEB-INF/lib/pear/System.php +++ b/WEB-INF/lib/pear/System.php @@ -9,7 +9,6 @@ * @author Tomas V.V.Cox * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: System.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -51,7 +50,7 @@ $GLOBALS['_System_temp_files'] = array(); * @author Tomas V.V. Cox * @copyright 1997-2006 The PHP Group * @license http://opensource.org/licenses/bsd-license.php New BSD License -* @version Release: 1.9.4 +* @version Release: 1.10.1 * @link http://pear.php.net/package/PEAR * @since Class available since Release 0.1 * @static @@ -65,12 +64,27 @@ class System * @param string $short_options the allowed option short-tags * @param string $long_options the allowed option long-tags * @return array the given options and there values - * @static - * @access private */ - function _parseArgs($argv, $short_options, $long_options = null) + public static function _parseArgs($argv, $short_options, $long_options = null) { if (!is_array($argv) && $argv !== null) { + /* + // Quote all items that are a short option + $av = preg_split('/(\A| )--?[a-z0-9]+[ =]?((?getMessage(); @@ -124,10 +137,8 @@ class System * @param integer $aktinst starting deep of the lookup * @param bool $silent if true, do not emit errors. * @return array the structure of the dir - * @static - * @access private */ - function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) + protected static function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) { $struct = array('dirs' => array(), 'files' => array()); if (($dir = @opendir($sPath)) === false) { @@ -170,7 +181,7 @@ class System * @static * @see System::_dirToStruct() */ - function _multipleToStruct($files) + protected static function _multipleToStruct($files) { $struct = array('dirs' => array(), 'files' => array()); settype($files, 'array'); @@ -196,7 +207,7 @@ class System * @static * @access public */ - function rm($args) + public static function rm($args) { $opts = System::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-) if (PEAR::isError($opts)) { @@ -239,10 +250,8 @@ class System * The -p option will create parent directories * @param string $args the name of the director(y|ies) to create * @return bool True for success - * @static - * @access public */ - function mkDir($args) + public static function mkDir($args) { $opts = System::_parseArgs($args, 'pm:'); if (PEAR::isError($opts)) { @@ -310,10 +319,8 @@ class System * * @param string $args the arguments * @return boolean true on success - * @static - * @access public */ - function &cat($args) + public static function &cat($args) { $ret = null; $files = array(); @@ -384,10 +391,8 @@ class System * @param string $args The arguments * @return mixed the full path of the created (file|dir) or false * @see System::tmpdir() - * @static - * @access public */ - function mktemp($args = null) + public static function mktemp($args = null) { static $first_time = true; $opts = System::_parseArgs($args, 't:d'); @@ -436,11 +441,8 @@ class System /** * Remove temporary files created my mkTemp. This function is executed * at script shutdown time - * - * @static - * @access private */ - function _removeTmpFiles() + public static function _removeTmpFiles() { if (count($GLOBALS['_System_temp_files'])) { $delete = $GLOBALS['_System_temp_files']; @@ -456,10 +458,9 @@ class System * Note: php.ini-recommended removes the "E" from the variables_order setting, * making unavaible the $_ENV array, that s why we do tests with _ENV * - * @static * @return string The temporary directory on the system */ - function tmpdir() + public static function tmpdir() { if (OS_WINDOWS) { if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { @@ -489,10 +490,9 @@ class System * @param mixed $fallback Value to return if $program is not found * * @return mixed A string with the full path or false if not found - * @static * @author Stig Bakken */ - function which($program, $fallback = false) + public static function which($program, $fallback = false) { // enforce API if (!is_string($program) || '' == $program) { @@ -504,13 +504,11 @@ class System $path_elements[] = dirname($program); $program = basename($program); } else { - // Honor safe mode - if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) { - $path = getenv('PATH'); - if (!$path) { - $path = getenv('Path'); // some OSes are just stupid enough to do this - } + $path = getenv('PATH'); + if (!$path) { + $path = getenv('Path'); // some OSes are just stupid enough to do this } + $path_elements = explode(PATH_SEPARATOR, $path); } @@ -522,17 +520,14 @@ class System if (strpos($program, '.') !== false) { array_unshift($exe_suffixes, ''); } - // is_executable() is not available on windows for PHP4 - $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file'; } else { $exe_suffixes = array(''); - $pear_is_executable = 'is_executable'; } foreach ($exe_suffixes as $suff) { foreach ($path_elements as $dir) { $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; - if (@$pear_is_executable($file)) { + if (is_executable($file)) { return $file; } } @@ -561,10 +556,8 @@ class System * * @param mixed Either array or string with the command line * @return array Array of found files - * @static - * */ - function find($args) + public static function find($args) { if (!is_array($args)) { $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);