From 134f86e8d5c414409631b25b8c6f0ee45fbd8631 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 3 Nov 2016 21:44:39 +1000 Subject: Initial update to OpenSim 0.8.2.1 source code. --- web/phpxmlrpclib/compat/array_key_exists.php | 55 -------- web/phpxmlrpclib/compat/is_a.php | 47 ------- web/phpxmlrpclib/compat/is_callable.php | 53 -------- web/phpxmlrpclib/compat/is_scalar.php | 38 ------ web/phpxmlrpclib/compat/var_export.php | 105 ---------------- web/phpxmlrpclib/compat/version_compare.php | 179 --------------------------- 6 files changed, 477 deletions(-) delete mode 100644 web/phpxmlrpclib/compat/array_key_exists.php delete mode 100644 web/phpxmlrpclib/compat/is_a.php delete mode 100644 web/phpxmlrpclib/compat/is_callable.php delete mode 100644 web/phpxmlrpclib/compat/is_scalar.php delete mode 100644 web/phpxmlrpclib/compat/var_export.php delete mode 100644 web/phpxmlrpclib/compat/version_compare.php (limited to 'web/phpxmlrpclib/compat') diff --git a/web/phpxmlrpclib/compat/array_key_exists.php b/web/phpxmlrpclib/compat/array_key_exists.php deleted file mode 100644 index 4a93ce4..0000000 --- a/web/phpxmlrpclib/compat/array_key_exists.php +++ /dev/null @@ -1,55 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: array_key_exists.php 2 2009-03-16 20:22:51Z ggiunta $ - - -/** - * Replace array_key_exists() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.array_key_exists - * @author Aidan Lister - * @version $Revision: 1.1 $ - * @since PHP 4.1.0 - * @require PHP 4.0.0 (user_error) - */ -if (!function_exists('array_key_exists')) { - function array_key_exists($key, $search) - { - if (!is_scalar($key)) { - user_error('array_key_exists() The first argument should be either a string or an integer', - E_USER_WARNING); - return false; - } - - if (is_object($search)) { - $search = get_object_vars($search); - } - - if (!is_array($search)) { - user_error('array_key_exists() The second argument should be either an array or an object', - E_USER_WARNING); - return false; - } - - return in_array($key, array_keys($search)); - } -} - -?> \ No newline at end of file diff --git a/web/phpxmlrpclib/compat/is_a.php b/web/phpxmlrpclib/compat/is_a.php deleted file mode 100644 index 2c5c129..0000000 --- a/web/phpxmlrpclib/compat/is_a.php +++ /dev/null @@ -1,47 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: is_a.php 2 2009-03-16 20:22:51Z ggiunta $ - - -/** - * Replace function is_a() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.is_a - * @author Aidan Lister - * @version $Revision: 1.2 $ - * @since PHP 4.2.0 - * @require PHP 4.0.0 (user_error) (is_subclass_of) - */ -if (!function_exists('is_a')) { - function is_a($object, $class) - { - if (!is_object($object)) { - return false; - } - - if (get_class($object) == strtolower($class)) { - return true; - } else { - return is_subclass_of($object, $class); - } - } -} - -?> \ No newline at end of file diff --git a/web/phpxmlrpclib/compat/is_callable.php b/web/phpxmlrpclib/compat/is_callable.php deleted file mode 100644 index 419697a..0000000 --- a/web/phpxmlrpclib/compat/is_callable.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @version $Id: is_callable.php 2 2009-03-16 20:22:51Z ggiunta $ - * @since PHP 4.0.6 - * @require PHP 4.0.0 (true, false, etc...) - * @todo add the 3rd parameter syntax... - */ -if (!function_exists('is_callable')) { - function is_callable($var, $syntax_only=false) - { - if ($syntax_only) - { - /* from The Manual: - * If the syntax_only argument is TRUE the function only verifies - * that var might be a function or method. It will only reject simple - * variables that are not strings, or an array that does not have a - * valid structure to be used as a callback. The valid ones are - * supposed to have only 2 entries, the first of which is an object - * or a string, and the second a string - */ - return (is_string($var) || (is_array($var) && count($var) == 2 && is_string(end($var)) && (is_string(reset($var)) || is_object(reset($var))))); - } - else - { - if (is_string($var)) - { - return function_exists($var); - } - else if (is_array($var) && count($var) == 2 && is_string($method = end($var))) - { - $obj = reset($var); - if (is_string($obj)) - { - $methods = get_class_methods($obj); - return (bool)(is_array($methods) && in_array(strtolower($method), $methods)); - } - else if (is_object($obj)) - { - return method_exists($obj, $method); - } - } - return false; - } - } -} - -?> \ No newline at end of file diff --git a/web/phpxmlrpclib/compat/is_scalar.php b/web/phpxmlrpclib/compat/is_scalar.php deleted file mode 100644 index dd87730..0000000 --- a/web/phpxmlrpclib/compat/is_scalar.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/web/phpxmlrpclib/compat/var_export.php b/web/phpxmlrpclib/compat/var_export.php deleted file mode 100644 index 7273a1e..0000000 --- a/web/phpxmlrpclib/compat/var_export.php +++ /dev/null @@ -1,105 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: var_export.php 2 2009-03-16 20:22:51Z ggiunta $ - - -/** - * Replace var_export() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.var_export - * @author Aidan Lister - * @version $Revision: 1.2 $ - * @since PHP 4.2.0 - * @require PHP 4.0.0 (user_error) - */ -if (!function_exists('var_export')) { - function var_export($array, $return = false, $lvl=0) - { - // Common output variables - $indent = ' '; - $doublearrow = ' => '; - $lineend = ",\n"; - $stringdelim = '\''; - - // Check the export isn't a simple string / int - if (is_string($array)) { - $out = $stringdelim . str_replace('\'', '\\\'', str_replace('\\', '\\\\', $array)) . $stringdelim; - } elseif (is_int($array) || is_float($array)) { - $out = (string)$array; - } elseif (is_bool($array)) { - $out = $array ? 'true' : 'false'; - } elseif (is_null($array)) { - $out = 'NULL'; - } elseif (is_resource($array)) { - $out = 'resource'; - } else { - // Begin the array export - // Start the string - $out = "array (\n"; - - // Loop through each value in array - foreach ($array as $key => $value) { - // If the key is a string, delimit it - if (is_string($key)) { - $key = str_replace('\'', '\\\'', str_replace('\\', '\\\\', $key)); - $key = $stringdelim . $key . $stringdelim; - } - - $val = var_export($value, true, $lvl+1); - // Delimit value - /*if (is_array($value)) { - // We have an array, so do some recursion - // Do some basic recursion while increasing the indent - $recur_array = explode($newline, var_export($value, true)); - $temp_array = array(); - foreach ($recur_array as $recur_line) { - $temp_array[] = $indent . $recur_line; - } - $recur_array = implode($newline, $temp_array); - $value = $newline . $recur_array; - } elseif (is_null($value)) { - $value = 'NULL'; - } else { - $value = str_replace($find, $replace, $value); - $value = $stringdelim . $value . $stringdelim; - }*/ - - // Piece together the line - for ($i = 0; $i < $lvl; $i++) - $out .= $indent; - $out .= $key . $doublearrow . $val . $lineend; - } - - // End our string - for ($i = 0; $i < $lvl; $i++) - $out .= $indent; - $out .= ")"; - } - - // Decide method of output - if ($return === true) { - return $out; - } else { - echo $out; - return; - } - } -} -?> \ No newline at end of file diff --git a/web/phpxmlrpclib/compat/version_compare.php b/web/phpxmlrpclib/compat/version_compare.php deleted file mode 100644 index a1211ea..0000000 --- a/web/phpxmlrpclib/compat/version_compare.php +++ /dev/null @@ -1,179 +0,0 @@ - | -// | Aidan Lister | -// +----------------------------------------------------------------------+ -// -// $Id: version_compare.php 2 2009-03-16 20:22:51Z ggiunta $ - - -/** - * Replace version_compare() - * - * @category PHP - * @package PHP_Compat - * @link http://php.net/function.version_compare - * @author Philippe Jausions - * @author Aidan Lister - * @version $Revision: 1.1 $ - * @since PHP 4.1.0 - * @require PHP 4.0.0 (user_error) - */ -if (!function_exists('version_compare')) { - function version_compare($version1, $version2, $operator = '<') - { - // Check input - if (!is_scalar($version1)) { - user_error('version_compare() expects parameter 1 to be string, ' . - gettype($version1) . ' given', E_USER_WARNING); - return; - } - - if (!is_scalar($version2)) { - user_error('version_compare() expects parameter 2 to be string, ' . - gettype($version2) . ' given', E_USER_WARNING); - return; - } - - if (!is_scalar($operator)) { - user_error('version_compare() expects parameter 3 to be string, ' . - gettype($operator) . ' given', E_USER_WARNING); - return; - } - - // Standardise versions - $v1 = explode('.', - str_replace('..', '.', - preg_replace('/([^0-9\.]+)/', '.$1.', - str_replace(array('-', '_', '+'), '.', - trim($version1))))); - - $v2 = explode('.', - str_replace('..', '.', - preg_replace('/([^0-9\.]+)/', '.$1.', - str_replace(array('-', '_', '+'), '.', - trim($version2))))); - - // Replace empty entries at the start of the array - while (empty($v1[0]) && array_shift($v1)) {} - while (empty($v2[0]) && array_shift($v2)) {} - - // Release state order - // '#' stands for any number - $versions = array( - 'dev' => 0, - 'alpha' => 1, - 'a' => 1, - 'beta' => 2, - 'b' => 2, - 'RC' => 3, - '#' => 4, - 'p' => 5, - 'pl' => 5); - - // Loop through each segment in the version string - $compare = 0; - for ($i = 0, $x = min(count($v1), count($v2)); $i < $x; $i++) { - if ($v1[$i] == $v2[$i]) { - continue; - } - $i1 = $v1[$i]; - $i2 = $v2[$i]; - if (is_numeric($i1) && is_numeric($i2)) { - $compare = ($i1 < $i2) ? -1 : 1; - break; - } - // We use the position of '#' in the versions list - // for numbers... (so take care of # in original string) - if ($i1 == '#') { - $i1 = ''; - } elseif (is_numeric($i1)) { - $i1 = '#'; - } - if ($i2 == '#') { - $i2 = ''; - } elseif (is_numeric($i2)) { - $i2 = '#'; - } - if (isset($versions[$i1]) && isset($versions[$i2])) { - $compare = ($versions[$i1] < $versions[$i2]) ? -1 : 1; - } elseif (isset($versions[$i1])) { - $compare = 1; - } elseif (isset($versions[$i2])) { - $compare = -1; - } else { - $compare = 0; - } - - break; - } - - // If previous loop didn't find anything, compare the "extra" segments - if ($compare == 0) { - if (count($v2) > count($v1)) { - if (isset($versions[$v2[$i]])) { - $compare = ($versions[$v2[$i]] < 4) ? 1 : -1; - } else { - $compare = -1; - } - } elseif (count($v2) < count($v1)) { - if (isset($versions[$v1[$i]])) { - $compare = ($versions[$v1[$i]] < 4) ? -1 : 1; - } else { - $compare = 1; - } - } - } - - // Compare the versions - if (func_num_args() > 2) { - switch ($operator) { - case '>': - case 'gt': - return (bool) ($compare > 0); - break; - case '>=': - case 'ge': - return (bool) ($compare >= 0); - break; - case '<=': - case 'le': - return (bool) ($compare <= 0); - break; - case '==': - case '=': - case 'eq': - return (bool) ($compare == 0); - break; - case '<>': - case '!=': - case 'ne': - return (bool) ($compare != 0); - break; - case '': - case '<': - case 'lt': - return (bool) ($compare < 0); - break; - default: - return; - } - } - - return $compare; - } -} - -?> \ No newline at end of file -- cgit v1.1