From 74e78343f240a126b871578d9d03a78a0b1dcf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 15 Sep 2017 12:26:00 +0900 Subject: [PATCH 1/5] =?UTF-8?q?vendor=E3=81=AE=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=AB=E5=85=88=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .travis.yml | 10 +++++----- composer.json | 1 + html/admin/require.php | 1 - html/define.php | 1 + html/install/index.php | 1 - html/require.php | 1 - 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 218ee79d0d..52dc0bdab1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ !.gitmodule composer.phar -/vendor/ +/data/vendor/ *.cache *.log /data/config/config.php diff --git a/.travis.yml b/.travis.yml index 7b7c7cedc1..38b192bdc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,18 +32,18 @@ before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - php -S localhost:8085 -t html/ & - - php vendor/bin/codecept build + - php data/vendor/bin/codecept build script: - mkdir -p reports/coverage - - php vendor/bin/phpunit -c phpunit.xml.dist - - php vendor/bin/codecept run --env travis --steps + - php data/vendor/bin/phpunit -c phpunit.xml.dist + - php data/vendor/bin/codecept run --env travis --steps after_script: - - php vendor/bin/coveralls -v + - php data/vendor/bin/coveralls -v # Cache folder, you can delete cache from Travis CI web interface cache: directories: - - vendor + - data/vendor - $HOME/.composer/cache vendor/ diff --git a/composer.json b/composer.json index 64e7056f5e..3695010318 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "config": { "disable-tls": true, "secure-http": false, + "vendor-dir": "data/vendor", "platform": { "php": "5.4" } diff --git a/html/admin/require.php b/html/admin/require.php index 1daa5b0b89..95e82ff0d8 100644 --- a/html/admin/require.php +++ b/html/admin/require.php @@ -20,7 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require __DIR__.'/../../vendor/autoload.php'; // rtrim は PHP バージョン依存対策 $GLOBALS['_realdir'] = rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/../'), '/\\') . '/'; $GLOBALS['_realdir'] = str_replace('\\', '/', $GLOBALS['_realdir']); diff --git a/html/define.php b/html/define.php index df59e8a1d4..2d52e33ef6 100644 --- a/html/define.php +++ b/html/define.php @@ -12,6 +12,7 @@ * ※ IIS は、POST 時にファイル名を使用しないと不具合が発生する。(http://support.microsoft.com/kb/247536/ja) */ define('USE_FILENAME_DIR_INDEX', null); +require_once HTML_REALDIR . HTML2DATA_DIR . 'vendor/autoload.php'; // bufferを初期化する while (ob_get_level() > 0 && ob_get_level() > 0) { diff --git a/html/install/index.php b/html/install/index.php index 621a7af679..317e1a7e4f 100644 --- a/html/install/index.php +++ b/html/install/index.php @@ -20,7 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require __DIR__.'/../../vendor/autoload.php'; // ▼require.php 相当 // rtrim は PHP バージョン依存対策 $GLOBALS['_realdir'] = rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/../'), '/\\') . '/'; diff --git a/html/require.php b/html/require.php index e23c65663c..fecb9d18be 100644 --- a/html/require.php +++ b/html/require.php @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require __DIR__.'/../vendor/autoload.php'; // rtrim は PHP バージョン依存対策 $GLOBALS['_realdir'] = rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/'), '/\\') . '/'; $GLOBALS['_realdir'] = str_replace('\\', '/', $GLOBALS['_realdir']); From 55fca11a9e24cd8a86d6655b92c30a1a399bad5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 15 Sep 2017 15:43:50 +0900 Subject: [PATCH 2/5] =?UTF-8?q?PEAR5=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_Query.php | 2 +- data/module/PEAR.php | 1072 --------------------------------------- data/module/PEAR5.php | 33 -- 3 files changed, 1 insertion(+), 1106 deletions(-) delete mode 100644 data/module/PEAR.php delete mode 100644 data/module/PEAR5.php diff --git a/data/class/SC_Query.php b/data/class/SC_Query.php index c9d0988362..11833dc152 100644 --- a/data/class/SC_Query.php +++ b/data/class/SC_Query.php @@ -1040,7 +1040,7 @@ public function execute(&$sth, $arrVal = array()) // #1658 (SC_Query の各種メソッドでプレースホルダの数に誤りがあるとメモリリークが発生する) 対応 // TODO 現状は PEAR 内のバックトレースを抑制することで、メモリーリークの影響を小さくしている。 // 根本的には、そのバックトレースが、どこに居座っているかを特定して、対策すべき。 - $pear_property =& PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); + $pear_property =& PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); $bak = $pear_property; $pear_property = true; diff --git a/data/module/PEAR.php b/data/module/PEAR.php deleted file mode 100644 index b955a8ec08..0000000000 --- a/data/module/PEAR.php +++ /dev/null @@ -1,1072 +0,0 @@ - - * @author Stig Bakken - * @author Tomas V.V.Cox - * @author Greg Beaver - * @copyright 1997-2010 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: commit 01071ee7b71e4d38c4e96fdf0ae5e411841eaec7 - * @link http://pear.php.net/package/PEAR - * @since File available since Release 0.1 - */ - -/**#@+ - * ERROR constants - */ -define('PEAR_ERROR_RETURN', 1); -define('PEAR_ERROR_PRINT', 2); -define('PEAR_ERROR_TRIGGER', 4); -define('PEAR_ERROR_DIE', 8); -define('PEAR_ERROR_CALLBACK', 16); -/** - * WARNING: obsolete - * @deprecated - */ -define('PEAR_ERROR_EXCEPTION', 32); -/**#@-*/ -define('PEAR_ZE2', (function_exists('version_compare') && - version_compare(zend_version(), "2-dev", "ge"))); - -if (substr(PHP_OS, 0, 3) == 'WIN') { - define('OS_WINDOWS', true); - define('OS_UNIX', false); - define('PEAR_OS', 'Windows'); -} else { - define('OS_WINDOWS', false); - define('OS_UNIX', true); - define('PEAR_OS', 'Unix'); // blatant assumption -} - -$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; -$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; -$GLOBALS['_PEAR_destructor_object_list'] = array(); -$GLOBALS['_PEAR_shutdown_funcs'] = array(); -$GLOBALS['_PEAR_error_handler_stack'] = array(); - -@ini_set('track_errors', true); - -/** - * Base class for other PEAR classes. Provides rudimentary - * emulation of destructors. - * - * If you want a destructor in your class, inherit PEAR and make a - * destructor method called _yourclassname (same name as the - * constructor, but with a "_" prefix). Also, in your constructor you - * have to call the PEAR constructor: $this->PEAR();. - * The destructor method will be called without parameters. Note that - * at in some SAPI implementations (such as Apache), any output during - * the request shutdown (in which destructors are called) seems to be - * discarded. If you need to get any debug information from your - * destructor, use error_log(), syslog() or something similar. - * - * IMPORTANT! To use the emulated destructors you need to create the - * objects by reference: $obj =& new PEAR_child; - * - * @category pear - * @package PEAR - * @author Stig Bakken - * @author Tomas V.V. Cox - * @author Greg Beaver - * @copyright 1997-2006 The PHP Group - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PEAR - * @see PEAR_Error - * @since Class available since PHP 4.0.2 - * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear - */ -class PEAR -{ - /** - * Whether to enable internal debug messages. - * - * @var bool - * @access private - */ - var $_debug = false; - - /** - * Default error mode for this object. - * - * @var int - * @access private - */ - var $_default_error_mode = null; - - /** - * Default error options used for this object when error mode - * is PEAR_ERROR_TRIGGER. - * - * @var int - * @access private - */ - var $_default_error_options = null; - - /** - * Default error handler (callback) for this object, if error mode is - * PEAR_ERROR_CALLBACK. - * - * @var string - * @access private - */ - var $_default_error_handler = ''; - - /** - * Which class to use for error objects. - * - * @var string - * @access private - */ - var $_error_class = 'PEAR_Error'; - - /** - * An array of expected errors. - * - * @var array - * @access private - */ - var $_expected_errors = array(); - - /** - * Constructor. Registers this object in - * $_PEAR_destructor_object_list for destructor emulation if a - * destructor object exists. - * - * @param string $error_class (optional) which class to use for - * error objects, defaults to PEAR_Error. - * @access public - * @return void - */ - function PEAR($error_class = null) - { - $classname = strtolower(get_class($this)); - if ($this->_debug) { - print "PEAR constructor called, class=$classname\n"; - } - - if ($error_class !== null) { - $this->_error_class = $error_class; - } - - while ($classname && strcasecmp($classname, "pear")) { - $destructor = "_$classname"; - if (method_exists($this, $destructor)) { - global $_PEAR_destructor_object_list; - $_PEAR_destructor_object_list[] = &$this; - if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { - register_shutdown_function("_PEAR_call_destructors"); - $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; - } - break; - } else { - $classname = get_parent_class($classname); - } - } - } - - /** - * Destructor (the emulated type of...). Does nothing right now, - * but is included for forward compatibility, so subclass - * destructors should always call it. - * - * See the note in the class desciption about output from - * destructors. - * - * @access public - * @return void - */ - function _PEAR() { - if ($this->_debug) { - printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); - } - } - - /** - * If you have a class that's mostly/entirely static, and you need static - * properties, you can use this method to simulate them. Eg. in your method(s) - * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); - * You MUST use a reference, or they will not persist! - * - * @access public - * @param string $class The calling classname, to prevent clashes - * @param string $var The variable to retrieve. - * @return mixed A reference to the variable. If not set it will be - * auto initialised to NULL. - */ - function &getStaticProperty($class, $var) - { - static $properties; - if (!isset($properties[$class])) { - $properties[$class] = array(); - } - - if (!array_key_exists($var, $properties[$class])) { - $properties[$class][$var] = null; - } - - return $properties[$class][$var]; - } - - /** - * Use this function to register a shutdown method for static - * classes. - * - * @access public - * @param mixed $func The function name (or array of class/method) to call - * @param mixed $args The arguments to pass to the function - * @return void - */ - function registerShutdownFunc($func, $args = array()) - { - // if we are called statically, there is a potential - // that no shutdown func is registered. Bug #6445 - if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { - register_shutdown_function("_PEAR_call_destructors"); - $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; - } - $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); - } - - /** - * Tell whether a value is a PEAR error. - * - * @param mixed $data the value to test - * @param int $code if $data is an error object, return true - * only if $code is a string and - * $obj->getMessage() == $code or - * $code is an integer and $obj->getCode() == $code - * @access public - * @return bool true if parameter is an error - */ - function isError($data, $code = null) - { - if (!is_object($data)) { - return false; - } - if (!is_a($data, 'PEAR_Error')) { - return false; - } - - if (is_null($code)) { - return true; - } elseif (is_string($code)) { - return $data->getMessage() == $code; - } - - return $data->getCode() == $code; - } - - /** - * Sets how errors generated by this object should be handled. - * Can be invoked both in objects and statically. If called - * statically, setErrorHandling sets the default behaviour for all - * PEAR objects. If called in an object, setErrorHandling sets - * the default behaviour for that object. - * - * @param int $mode - * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, - * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. - * - * @param mixed $options - * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one - * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). - * - * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected - * to be the callback function or method. A callback - * function is a string with the name of the function, a - * callback method is an array of two elements: the element - * at index 0 is the object, and the element at index 1 is - * the name of the method to call in the object. - * - * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is - * a printf format string used when printing the error - * message. - * - * @access public - * @return void - * @see PEAR_ERROR_RETURN - * @see PEAR_ERROR_PRINT - * @see PEAR_ERROR_TRIGGER - * @see PEAR_ERROR_DIE - * @see PEAR_ERROR_CALLBACK - * @see PEAR_ERROR_EXCEPTION - * - * @since PHP 4.0.5 - */ - function setErrorHandling($mode = null, $options = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $setmode = &$this->_default_error_mode; - $setoptions = &$this->_default_error_options; - } else { - $setmode = &$GLOBALS['_PEAR_default_error_mode']; - $setoptions = &$GLOBALS['_PEAR_default_error_options']; - } - - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $setmode = $mode; - $setoptions = $options; - break; - - case PEAR_ERROR_CALLBACK: - $setmode = $mode; - // class/object method callback - if (is_callable($options)) { - $setoptions = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - } - - /** - * This method is used to tell which errors you expect to get. - * Expected errors are always returned with error mode - * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, - * and this method pushes a new element onto it. The list of - * expected errors are in effect until they are popped off the - * stack with the popExpect() method. - * - * Note that this method can not be called statically - * - * @param mixed $code a single error code or an array of error codes to expect - * - * @return int the new depth of the "expected errors" stack - * @access public - */ - function expectError($code = '*') - { - if (is_array($code)) { - array_push($this->_expected_errors, $code); - } else { - array_push($this->_expected_errors, array($code)); - } - return count($this->_expected_errors); - } - - /** - * This method pops one element off the expected error codes - * stack. - * - * @return array the list of error codes that were popped - */ - function popExpect() - { - return array_pop($this->_expected_errors); - } - - /** - * This method checks unsets an error code if available - * - * @param mixed error code - * @return bool true if the error code was unset, false otherwise - * @access private - * @since PHP 4.3.0 - */ - function _checkDelExpect($error_code) - { - $deleted = false; - foreach ($this->_expected_errors as $key => $error_array) { - if (in_array($error_code, $error_array)) { - unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); - $deleted = true; - } - - // clean up empty arrays - if (0 == count($this->_expected_errors[$key])) { - unset($this->_expected_errors[$key]); - } - } - - return $deleted; - } - - /** - * This method deletes all occurences of the specified element from - * the expected error codes stack. - * - * @param mixed $error_code error code that should be deleted - * @return mixed list of error codes that were deleted or error - * @access public - * @since PHP 4.3.0 - */ - function delExpect($error_code) - { - $deleted = false; - if ((is_array($error_code) && (0 != count($error_code)))) { - // $error_code is a non-empty array here; we walk through it trying - // to unset all values - foreach ($error_code as $key => $error) { - $deleted = $this->_checkDelExpect($error) ? true : false; - } - - return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME - } elseif (!empty($error_code)) { - // $error_code comes alone, trying to unset it - if ($this->_checkDelExpect($error_code)) { - return true; - } - - return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME - } - - // $error_code is empty - return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME - } - - /** - * This method is a wrapper that returns an instance of the - * configured error class with this object's default error - * handling applied. If the $mode and $options parameters are not - * specified, the object's defaults are used. - * - * @param mixed $message a text error message or a PEAR error object - * - * @param int $code a numeric error code (it is up to your class - * to define these if you want to use codes) - * - * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, - * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. - * - * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter - * specifies the PHP-internal error level (one of - * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). - * If $mode is PEAR_ERROR_CALLBACK, this - * parameter specifies the callback function or - * method. In other error modes this parameter - * is ignored. - * - * @param string $userinfo If you need to pass along for example debug - * information, this parameter is meant for that. - * - * @param string $error_class The returned error object will be - * instantiated from this class, if specified. - * - * @param bool $skipmsg If true, raiseError will only pass error codes, - * the error message parameter will be dropped. - * - * @access public - * @return object a PEAR error object - * @see PEAR::setErrorHandling - * @since PHP 4.0.5 - */ - function &raiseError($message = null, - $code = null, - $mode = null, - $options = null, - $userinfo = null, - $error_class = null, - $skipmsg = false) - { - // The error is yet a PEAR error object - if (is_object($message)) { - $code = $message->getCode(); - $userinfo = $message->getUserInfo(); - $error_class = $message->getType(); - $message->error_message_prefix = ''; - $message = $message->getMessage(); - - // Make sure right data gets passed. - $r = new ReflectionClass($error_class); - $c = $r->getConstructor(); - $p = array_shift($c->getParameters()); - $skipmsg = ($p->getName() != 'message'); - } - - if ( - isset($this) && - isset($this->_expected_errors) && - count($this->_expected_errors) > 0 && - count($exp = end($this->_expected_errors)) - ) { - if ($exp[0] == "*" || - (is_int(reset($exp)) && in_array($code, $exp)) || - (is_string(reset($exp)) && in_array($message, $exp)) - ) { - $mode = PEAR_ERROR_RETURN; - } - } - - // No mode given, try global ones - if ($mode === null) { - // Class error handler - if (isset($this) && isset($this->_default_error_mode)) { - $mode = $this->_default_error_mode; - $options = $this->_default_error_options; - // Global error handler - } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { - $mode = $GLOBALS['_PEAR_default_error_mode']; - $options = $GLOBALS['_PEAR_default_error_options']; - } - } - - if ($error_class !== null) { - $ec = $error_class; - } elseif (isset($this) && isset($this->_error_class)) { - $ec = $this->_error_class; - } else { - $ec = 'PEAR_Error'; - } - - if (intval(PHP_VERSION) < 5) { - // little non-eval hack to fix bug #12147 - include 'PEAR/FixPHP5PEARWarnings.php'; - return $a; - } - - if ($skipmsg) { - $a = new $ec($code, $mode, $options, $userinfo); - } else { - $a = new $ec($message, $code, $mode, $options, $userinfo); - } - - return $a; - } - - /** - * Simpler form of raiseError with fewer options. In most cases - * message, code and userinfo are enough. - * - * @param mixed $message a text error message or a PEAR error object - * - * @param int $code a numeric error code (it is up to your class - * to define these if you want to use codes) - * - * @param string $userinfo If you need to pass along for example debug - * information, this parameter is meant for that. - * - * @access public - * @return object a PEAR error object - * @see PEAR::raiseError - */ - function &throwError($message = null, $code = null, $userinfo = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $a = &$this->raiseError($message, $code, null, null, $userinfo); - return $a; - } - - $a = &PEAR::raiseError($message, $code, null, null, $userinfo); - return $a; - } - - function staticPushErrorHandling($mode, $options = null) - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - $def_mode = &$GLOBALS['_PEAR_default_error_mode']; - $def_options = &$GLOBALS['_PEAR_default_error_options']; - $stack[] = array($def_mode, $def_options); - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $def_mode = $mode; - $def_options = $options; - break; - - case PEAR_ERROR_CALLBACK: - $def_mode = $mode; - // class/object method callback - if (is_callable($options)) { - $def_options = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - $stack[] = array($mode, $options); - return true; - } - - function staticPopErrorHandling() - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - $setmode = &$GLOBALS['_PEAR_default_error_mode']; - $setoptions = &$GLOBALS['_PEAR_default_error_options']; - array_pop($stack); - list($mode, $options) = $stack[sizeof($stack) - 1]; - array_pop($stack); - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $setmode = $mode; - $setoptions = $options; - break; - - case PEAR_ERROR_CALLBACK: - $setmode = $mode; - // class/object method callback - if (is_callable($options)) { - $setoptions = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - return true; - } - - /** - * Push a new error handler on top of the error handler options stack. With this - * you can easily override the actual error handler for some code and restore - * it later with popErrorHandling. - * - * @param mixed $mode (same as setErrorHandling) - * @param mixed $options (same as setErrorHandling) - * - * @return bool Always true - * - * @see PEAR::setErrorHandling - */ - function pushErrorHandling($mode, $options = null) - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - if (isset($this) && is_a($this, 'PEAR')) { - $def_mode = &$this->_default_error_mode; - $def_options = &$this->_default_error_options; - } else { - $def_mode = &$GLOBALS['_PEAR_default_error_mode']; - $def_options = &$GLOBALS['_PEAR_default_error_options']; - } - $stack[] = array($def_mode, $def_options); - - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); - } else { - PEAR::setErrorHandling($mode, $options); - } - $stack[] = array($mode, $options); - return true; - } - - /** - * Pop the last error handler used - * - * @return bool Always true - * - * @see PEAR::pushErrorHandling - */ - function popErrorHandling() - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - array_pop($stack); - list($mode, $options) = $stack[sizeof($stack) - 1]; - array_pop($stack); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); - } else { - PEAR::setErrorHandling($mode, $options); - } - return true; - } - - /** - * OS independant PHP extension load. Remember to take care - * on the correct extension name for case sensitive OSes. - * - * @param string $ext The extension name - * @return bool Success or not on the dl() call - */ - function loadExtension($ext) - { - if (extension_loaded($ext)) { - return true; - } - - // if either returns true dl() will produce a FATAL error, stop that - if ( - function_exists('dl') === false || - ini_get('enable_dl') != 1 || - ini_get('safe_mode') == 1 - ) { - return false; - } - - if (OS_WINDOWS) { - $suffix = '.dll'; - } elseif (PHP_OS == 'HP-UX') { - $suffix = '.sl'; - } elseif (PHP_OS == 'AIX') { - $suffix = '.a'; - } elseif (PHP_OS == 'OSX') { - $suffix = '.bundle'; - } else { - $suffix = '.so'; - } - - return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); - } -} - -if (PEAR_ZE2) { - include_once 'PEAR5.php'; -} - -function _PEAR_call_destructors() -{ - global $_PEAR_destructor_object_list; - if (is_array($_PEAR_destructor_object_list) && - sizeof($_PEAR_destructor_object_list)) - { - reset($_PEAR_destructor_object_list); - if (PEAR_ZE2) { - $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo'); - } else { - $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); - } - - if ($destructLifoExists) { - $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); - } - - while (list($k, $objref) = each($_PEAR_destructor_object_list)) { - $classname = get_class($objref); - while ($classname) { - $destructor = "_$classname"; - if (method_exists($objref, $destructor)) { - $objref->$destructor(); - break; - } else { - $classname = get_parent_class($classname); - } - } - } - // Empty the object list to ensure that destructors are - // not called more than once. - $_PEAR_destructor_object_list = array(); - } - - // Now call the shutdown functions - if ( - isset($GLOBALS['_PEAR_shutdown_funcs']) && - is_array($GLOBALS['_PEAR_shutdown_funcs']) && - !empty($GLOBALS['_PEAR_shutdown_funcs']) - ) { - foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { - call_user_func_array($value[0], $value[1]); - } - } -} - -/** - * Standard PEAR error class for PHP 4 - * - * This class is supserseded by {@link PEAR_Exception} in PHP 5 - * - * @category pear - * @package PEAR - * @author Stig Bakken - * @author Tomas V.V. Cox - * @author Gregory Beaver - * @copyright 1997-2006 The PHP Group - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/manual/en/core.pear.pear-error.php - * @see PEAR::raiseError(), PEAR::throwError() - * @since Class available since PHP 4.0.2 - */ -class PEAR_Error -{ - var $error_message_prefix = ''; - var $mode = PEAR_ERROR_RETURN; - var $level = E_USER_NOTICE; - var $code = -1; - var $message = ''; - var $userinfo = ''; - var $backtrace = null; - - /** - * PEAR_Error constructor - * - * @param string $message message - * - * @param int $code (optional) error code - * - * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, - * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, - * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION - * - * @param mixed $options (optional) error level, _OR_ in the case of - * PEAR_ERROR_CALLBACK, the callback function or object/method - * tuple. - * - * @param string $userinfo (optional) additional user/debug info - * - * @access public - * - */ - function PEAR_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - if ($mode === null) { - $mode = PEAR_ERROR_RETURN; - } - $this->message = $message; - $this->code = $code; - $this->mode = $mode; - $this->userinfo = $userinfo; - - if (PEAR_ZE2) { - $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); - } else { - $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); - } - - if (!$skiptrace) { - $this->backtrace = debug_backtrace(); - if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) { - unset($this->backtrace[0]['object']); - } - } - - if ($mode & PEAR_ERROR_CALLBACK) { - $this->level = E_USER_NOTICE; - $this->callback = $options; - } else { - if ($options === null) { - $options = E_USER_NOTICE; - } - - $this->level = $options; - $this->callback = null; - } - - if ($this->mode & PEAR_ERROR_PRINT) { - if (is_null($options) || is_int($options)) { - $format = "%s"; - } else { - $format = $options; - } - - printf($format, $this->getMessage()); - } - - if ($this->mode & PEAR_ERROR_TRIGGER) { - trigger_error($this->getMessage(), $this->level); - } - - if ($this->mode & PEAR_ERROR_DIE) { - $msg = $this->getMessage(); - if (is_null($options) || is_int($options)) { - $format = "%s"; - if (substr($msg, -1) != "\n") { - $msg .= "\n"; - } - } else { - $format = $options; - } - die(sprintf($format, $msg)); - } - - if ($this->mode & PEAR_ERROR_CALLBACK && is_callable($this->callback)) { - call_user_func($this->callback, $this); - } - - if ($this->mode & PEAR_ERROR_EXCEPTION) { - trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); - eval('$e = new Exception($this->message, $this->code);throw($e);'); - } - } - - /** - * Get the error mode from an error object. - * - * @return int error mode - * @access public - */ - function getMode() - { - return $this->mode; - } - - /** - * Get the callback function/method from an error object. - * - * @return mixed callback function or object/method array - * @access public - */ - function getCallback() - { - return $this->callback; - } - - /** - * Get the error message from an error object. - * - * @return string full error message - * @access public - */ - function getMessage() - { - return ($this->error_message_prefix . $this->message); - } - - /** - * Get error code from an error object - * - * @return int error code - * @access public - */ - function getCode() - { - return $this->code; - } - - /** - * Get the name of this error/exception. - * - * @return string error/exception name (type) - * @access public - */ - function getType() - { - return get_class($this); - } - - /** - * Get additional user-supplied information. - * - * @return string user-supplied information - * @access public - */ - function getUserInfo() - { - return $this->userinfo; - } - - /** - * Get additional debug information supplied by the application. - * - * @return string debug information - * @access public - */ - function getDebugInfo() - { - return $this->getUserInfo(); - } - - /** - * Get the call backtrace from where the error was generated. - * Supported with PHP 4.3.0 or newer. - * - * @param int $frame (optional) what frame to fetch - * @return array Backtrace, or NULL if not available. - * @access public - */ - function getBacktrace($frame = null) - { - if (defined('PEAR_IGNORE_BACKTRACE')) { - return null; - } - if ($frame === null) { - return $this->backtrace; - } - return $this->backtrace[$frame]; - } - - function addUserInfo($info) - { - if (empty($this->userinfo)) { - $this->userinfo = $info; - } else { - $this->userinfo .= " ** $info"; - } - } - - function __toString() - { - return $this->getMessage(); - } - - /** - * Make a string representation of this object. - * - * @return string a string with an object summary - * @access public - */ - function toString() - { - $modes = array(); - $levels = array(E_USER_NOTICE => 'notice', - E_USER_WARNING => 'warning', - E_USER_ERROR => 'error'); - if ($this->mode & PEAR_ERROR_CALLBACK) { - if (is_array($this->callback)) { - $callback = (is_object($this->callback[0]) ? - strtolower(get_class($this->callback[0])) : - $this->callback[0]) . '::' . - $this->callback[1]; - } else { - $callback = $this->callback; - } - return sprintf('[%s: message="%s" code=%d mode=callback '. - 'callback=%s prefix="%s" info="%s"]', - strtolower(get_class($this)), $this->message, $this->code, - $callback, $this->error_message_prefix, - $this->userinfo); - } - if ($this->mode & PEAR_ERROR_PRINT) { - $modes[] = 'print'; - } - if ($this->mode & PEAR_ERROR_TRIGGER) { - $modes[] = 'trigger'; - } - if ($this->mode & PEAR_ERROR_DIE) { - $modes[] = 'die'; - } - if ($this->mode & PEAR_ERROR_RETURN) { - $modes[] = 'return'; - } - return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. - 'prefix="%s" info="%s"]', - strtolower(get_class($this)), $this->message, $this->code, - implode("|", $modes), $levels[$this->level], - $this->error_message_prefix, - $this->userinfo); - } -} - -/* - * Local Variables: - * mode: php - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/data/module/PEAR5.php b/data/module/PEAR5.php deleted file mode 100644 index 5cee090351..0000000000 --- a/data/module/PEAR5.php +++ /dev/null @@ -1,33 +0,0 @@ - Date: Fri, 15 Sep 2017 18:30:04 +0900 Subject: [PATCH 3/5] =?UTF-8?q?HTTP=5FRequest=E3=81=AEtest=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 - composer.lock | 210 ++++++++++-------------- tests/class/module/HTTP/RequestTest.php | 31 ++++ 3 files changed, 122 insertions(+), 121 deletions(-) create mode 100644 tests/class/module/HTTP/RequestTest.php diff --git a/composer.json b/composer.json index 3695010318..931cd450c1 100644 --- a/composer.json +++ b/composer.json @@ -33,10 +33,8 @@ "pear-pear.php.net/PEAR" : "*", "pear-pear.php.net/Archive_Tar" : "*", "pear-pear.php.net/Mail" : "*", - "pear-pear.php.net/Calendar" : "*", "pear-pear.php.net/Cache_Lite" : "*", "pear-pear.php.net/File_SearchReplace" : "*", - "pear-pear.php.net/HTTP_Request" : "*", "pear-pear.php.net/MDB2_Driver_mysqli" : "1.5.0b4", "pear-pear.php.net/MDB2_Driver_pgsql" : "1.5.0b4", "pear-pear.php.net/MDB2" : "2.5.0-beta5 as 2.5.0", diff --git a/composer.lock b/composer.lock index 6fe5abb51f..dc119d042d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,14 +4,14 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "f426e51cd01ae4e2e02879aad4522883", + "content-hash": "f07f3a43793233c3c79ca9ad39a771cb", "packages": [ { "name": "pear-pear.php.net/Archive_Tar", - "version": "1.4.2", + "version": "1.4.3", "dist": { "type": "file", - "url": "http://pear.php.net/get/Archive_Tar-1.4.2.tgz", + "url": "http://pear.php.net/get/Archive_Tar-1.4.3.tgz", "reference": null, "shasum": null }, @@ -19,7 +19,7 @@ "php": ">=5.2.0.0" }, "replace": { - "pear-pear/archive_tar": "== 1.4.2.0" + "pear-pear/archive_tar": "== 1.4.3.0" }, "type": "pear-library", "autoload": { @@ -65,35 +65,6 @@ ], "description": "This package is a little cache system optimized for file containers. It is fast and safe (because it\n uses file locking and/or anti-corruption tests)." }, - { - "name": "pear-pear.php.net/Calendar", - "version": "0.5.5", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Calendar-0.5.5.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=5.0.0.0" - }, - "replace": { - "pear-pear/calendar": "== 0.5.5.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "BSD" - ], - "description": "Calendar provides an API for building Calendar data structures. Using\nthe simple iterator and it's "query" API, a user interface can easily be\nbuilt on top of the calendar data structure, at the same time easily connecting it\nto some kind of underlying data store, where "event" information is\nbeing held.\n\nIt provides different calculation "engines" the default being based on\nUnix timestamps (offering fastest performance) with an alternative using PEAR::Date\nwhich extends the calendar past the limitations of Unix timestamps. Other engines\nshould be implementable for other types of calendar (e.g. a Chinese Calendar based\non lunar cycles)." - }, { "name": "pear-pear.php.net/Console_Getopt", "version": "1.4.1", @@ -438,10 +409,10 @@ }, { "name": "pear-pear.php.net/PEAR", - "version": "1.10.4", + "version": "1.10.5", "dist": { "type": "file", - "url": "http://pear.php.net/get/PEAR-1.10.4.tgz", + "url": "http://pear.php.net/get/PEAR-1.10.5.tgz", "reference": null, "shasum": null }, @@ -459,7 +430,7 @@ "pear-pear.php.net/pear_frontend_web": "<=0.4.0.0" }, "replace": { - "pear-pear/pear": "== 1.10.4.0" + "pear-pear/pear": "== 1.10.5.0" }, "type": "pear-library", "autoload": { @@ -658,10 +629,10 @@ }, { "name": "pear-pear.php.net/XML_Util", - "version": "1.4.2", + "version": "1.4.3", "dist": { "type": "file", - "url": "http://pear.php.net/get/XML_Util-1.4.2.tgz", + "url": "http://pear.php.net/get/XML_Util-1.4.3.tgz", "reference": null, "shasum": null }, @@ -670,7 +641,7 @@ "php": ">=5.4.0.0" }, "replace": { - "pear-pear/xml_util": "== 1.4.2.0" + "pear-pear/xml_util": "== 1.4.3.0" }, "type": "pear-library", "autoload": { @@ -802,28 +773,28 @@ }, { "name": "codeception/codeception", - "version": "2.2.11", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080" + "reference": "e807cd458eb9f7ae7464f33ad835a2f54aa73194" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/a8681b416921ae282ccca2c485d75a3ed6756080", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/e807cd458eb9f7ae7464f33ad835a2f54aa73194", + "reference": "e807cd458eb9f7ae7464f33ad835a2f54aa73194", "shasum": "" }, "require": { "behat/gherkin": "~4.4.0", "ext-json": "*", "ext-mbstring": "*", - "facebook/webdriver": ">=1.0.1 <2.0", + "facebook/webdriver": ">=1.1.3 <2.0", "guzzlehttp/guzzle": ">=4.1.4 <7.0", "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">4.8.20 <6.0", + "phpunit/phpunit": ">4.8.20 <7.0", "phpunit/phpunit-mock-objects": ">2.3 <5.0", "sebastian/comparator": ">1.1 <3.0", "sebastian/diff": "^1.4", @@ -848,6 +819,7 @@ "php-amqplib/php-amqplib": "~2.4", "predis/predis": "^1.0", "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <4.0", "vlucas/phpdotenv": "^2.4.0" }, "suggest": { @@ -892,7 +864,7 @@ "functional testing", "unit testing" ], - "time": "2017-05-11T21:07:05+00:00" + "time": "2017-08-10T20:28:02+00:00" }, { "name": "doctrine/instantiator", @@ -1310,16 +1282,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { @@ -1355,26 +1327,26 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2015-02-03T12:10:50+00:00" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -1385,7 +1357,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1418,7 +1390,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1670,16 +1642,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -1738,7 +1710,7 @@ "testing", "xunit" ], - "time": "2017-02-06T05:18:07+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2068,23 +2040,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -2116,7 +2088,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -2421,16 +2393,16 @@ }, { "name": "symfony/browser-kit", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "4386755566fc8d29bddf89694663b0e96cb01e61" + "reference": "50cf5bfff540325d81ca2f2dc75ac2a5e446090d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/4386755566fc8d29bddf89694663b0e96cb01e61", - "reference": "4386755566fc8d29bddf89694663b0e96cb01e61", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/50cf5bfff540325d81ca2f2dc75ac2a5e446090d", + "reference": "50cf5bfff540325d81ca2f2dc75ac2a5e446090d", "shasum": "" }, "require": { @@ -2474,11 +2446,11 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-07-12T12:59:33+00:00" }, { "name": "symfony/config", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -2534,16 +2506,16 @@ }, { "name": "symfony/console", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2cfcbced8e39e2313ed4da8896fc8c59a56c0d7e" + "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2cfcbced8e39e2313ed4da8896fc8c59a56c0d7e", - "reference": "2cfcbced8e39e2313ed4da8896fc8c59a56c0d7e", + "url": "https://api.github.com/repos/symfony/console/zipball/c0807a2ca978e64d8945d373a9221a5c35d1a253", + "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253", "shasum": "" }, "require": { @@ -2591,11 +2563,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26T01:38:53+00:00" + "time": "2017-08-27T14:29:03+00:00" }, { "name": "symfony/css-selector", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2648,16 +2620,16 @@ }, { "name": "symfony/debug", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "344f50ce827413b3640bfcb1e37386a67d06ea1f" + "reference": "efc9656dcb227e1459905d5aa51e43dfec76e752" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/344f50ce827413b3640bfcb1e37386a67d06ea1f", - "reference": "344f50ce827413b3640bfcb1e37386a67d06ea1f", + "url": "https://api.github.com/repos/symfony/debug/zipball/efc9656dcb227e1459905d5aa51e43dfec76e752", + "reference": "efc9656dcb227e1459905d5aa51e43dfec76e752", "shasum": "" }, "require": { @@ -2701,20 +2673,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19T19:56:30+00:00" + "time": "2017-08-27T14:29:03+00:00" }, { "name": "symfony/dom-crawler", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "dd2fc76e011cb480b2d163c3b2deebd3de4471c8" + "reference": "2d902344b9902a0189408ab5d9e84fa4b233fcfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/dd2fc76e011cb480b2d163c3b2deebd3de4471c8", - "reference": "dd2fc76e011cb480b2d163c3b2deebd3de4471c8", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2d902344b9902a0189408ab5d9e84fa4b233fcfc", + "reference": "2d902344b9902a0189408ab5d9e84fa4b233fcfc", "shasum": "" }, "require": { @@ -2757,20 +2729,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-08-15T13:30:53+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531" + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fc8e2b4118ff316550596357325dfd92a51f531", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", "shasum": "" }, "require": { @@ -2817,20 +2789,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-26T16:56:54+00:00" + "time": "2017-06-02T07:47:27+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3" + "reference": "714b1036010c354ae2b25d7f9ca27e14e265e9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", - "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/714b1036010c354ae2b25d7f9ca27e14e265e9f2", + "reference": "714b1036010c354ae2b25d7f9ca27e14e265e9f2", "shasum": "" }, "require": { @@ -2866,20 +2838,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-07-11T07:12:11+00:00" }, { "name": "symfony/finder", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "16d55394b31547e4a8494551b85c9b9915545347" + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/16d55394b31547e4a8494551b85c9b9915545347", - "reference": "16d55394b31547e4a8494551b85c9b9915545347", + "url": "https://api.github.com/repos/symfony/finder/zipball/4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", "shasum": "" }, "require": { @@ -2915,20 +2887,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-06-01T20:52:29+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", "shasum": "" }, "require": { @@ -2940,7 +2912,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -2974,11 +2946,11 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-06-14T15:44:48+00:00" }, { "name": "symfony/stopwatch", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -3027,16 +2999,16 @@ }, { "name": "symfony/yaml", - "version": "v2.8.20", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02" + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/93ccdde79f4b079c7558da4656a3cb1c50c68e02", - "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", "shasum": "" }, "require": { @@ -3072,7 +3044,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:31:55+00:00" + "time": "2017-06-01T20:52:29+00:00" } ], "aliases": [ diff --git a/tests/class/module/HTTP/RequestTest.php b/tests/class/module/HTTP/RequestTest.php new file mode 100644 index 0000000000..095655bf78 --- /dev/null +++ b/tests/class/module/HTTP/RequestTest.php @@ -0,0 +1,31 @@ + + * @license + */ +class HTTP_RequestTest extends Common_TestCase +{ + + public function testConstructorSetsDefaults() + { + $url = new Net_URL('http://www.example.com/foo'); + $req = new HTTP_Request(); + $req->setMethod(HTTP_REQUEST_METHOD_POST); + $req->addPostData('Foo', 'bar'); + + $this->assertSame($url, $req->getUrl()); + $this->assertEquals(HTTP_REQUEST_METHOD_POST, $req->getMethod()); + } + +} From cc2376699eea11344f4f4ebbd5604191181eb27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 15 Sep 2017 18:44:51 +0900 Subject: [PATCH 4/5] =?UTF-8?q?composer.json=E3=81=8B=E3=82=89=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AA=E8=A8=98=E8=BF=B0=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 4 - composer.lock | 239 ++++++++++---------------------------------------- 2 files changed, 45 insertions(+), 198 deletions(-) diff --git a/composer.json b/composer.json index 931cd450c1..3ead9b4921 100644 --- a/composer.json +++ b/composer.json @@ -38,11 +38,7 @@ "pear-pear.php.net/MDB2_Driver_mysqli" : "1.5.0b4", "pear-pear.php.net/MDB2_Driver_pgsql" : "1.5.0b4", "pear-pear.php.net/MDB2" : "2.5.0-beta5 as 2.5.0", - "pear-pear.php.net/Net_SMTP" : "*", - "pear-pear.php.net/Net_Socket" : "*", - "pear-pear.php.net/Net_URL" : "*", "pear-pear.php.net/Net_UserAgent_Mobile" : "*", - "pear-pear.php.net/SOAP" : "*", "pear-pear.php.net/Services_JSON" : "*", "pear-pear.php.net/Text_Password" : "*", "pear-pear.php.net/XML_Parser" : "*", diff --git a/composer.lock b/composer.lock index dc119d042d..7a5a30d29e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "f07f3a43793233c3c79ca9ad39a771cb", + "hash": "ebc7013de986cc03eafd39d0ce86d7c0", + "content-hash": "301e39b26a89a7311c3cc326be45be83", "packages": [ { "name": "pear-pear.php.net/Archive_Tar", @@ -123,37 +124,6 @@ ], "description": "Provides various functions to perform replace\non files. Preg/Ereg regex supported along with faster, but more basic str_replace routine." }, - { - "name": "pear-pear.php.net/HTTP_Request", - "version": "1.4.4", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/HTTP_Request-1.4.4.tgz", - "reference": null, - "shasum": null - }, - "require": { - "pear-pear.php.net/net_socket": ">=1.0.7.0", - "pear-pear.php.net/net_url": ">=1.0.12.0", - "php": ">=4.2.0.0" - }, - "replace": { - "pear-pear/http_request": "== 1.4.4.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "BSD" - ], - "description": "Supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy,\nProxy Authentication, SSL, file uploads etc." - }, { "name": "pear-pear.php.net/MDB2", "version": "2.5.0b5", @@ -288,94 +258,6 @@ ], "description": "PEAR's Mail package defines an interface for implementing mailers under the PEAR hierarchy. It also provides supporting functions useful to multiple mailer backends. Currently supported backends include: PHP's native mail() function, sendmail, and SMTP. This package also provides a RFC822 email address list validation utility class." }, - { - "name": "pear-pear.php.net/Net_SMTP", - "version": "1.8.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Net_SMTP-1.8.0.tgz", - "reference": null, - "shasum": null - }, - "require": { - "pear-pear.php.net/net_socket": ">=1.0.7.0", - "php": ">=5.4.0.0" - }, - "replace": { - "pear-pear/net_smtp": "== 1.8.0.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "PHP License" - ], - "description": "Provides an implementation of the SMTP protocol using PEAR's Net_Socket class." - }, - { - "name": "pear-pear.php.net/Net_Socket", - "version": "1.2.2", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Net_Socket-1.2.2.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=5.4.0.0" - }, - "replace": { - "pear-pear/net_socket": "== 1.2.2.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "BSD-2-Clause" - ], - "description": "Net_Socket is a class interface to TCP sockets. It provides blocking\n and non-blocking operation, with different reading and writing modes\n (byte-wise, block-wise, line-wise and special formats like network\n byte-order ip addresses)." - }, - { - "name": "pear-pear.php.net/Net_URL", - "version": "1.0.15", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Net_URL-1.0.15.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=4.0.0.0" - }, - "replace": { - "pear-pear/net_url": "== 1.0.15.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "BSD" - ], - "description": "Provides easy parsing of URLs and their constituent parts." - }, { "name": "pear-pear.php.net/Net_UserAgent_Mobile", "version": "1.0.0", @@ -446,37 +328,6 @@ ], "description": "The PEAR package contains:\n * the PEAR installer, for creating, distributing\n and installing packages\n * the PEAR_Exception PHP5 error handling mechanism\n * the PEAR_ErrorStack advanced error handling mechanism\n * the PEAR_Error error handling mechanism\n * the OS_Guess class for retrieving info about the OS\n where PHP is running on\n * the System class for quick handling of common operations\n with files and directories\n * the PEAR base class\n Features in a nutshell:\n * full support for channels\n * pre-download dependency validation\n * new package.xml 2.0 format allows tremendous flexibility while maintaining BC\n * support for optional dependency groups and limited support for sub-packaging\n * robust dependency support\n * full dependency validation on uninstall\n * remote install for hosts with only ftp access - no more problems with\n restricted host installation\n * full support for mirroring\n * support for bundling several packages into a single tarball\n * support for static dependencies on a url-based package\n * support for custom file roles and installation tasks" }, - { - "name": "pear-pear.php.net/SOAP", - "version": "0.13.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/SOAP-0.13.0.tgz", - "reference": null, - "shasum": null - }, - "require": { - "pear-pear.php.net/http_request": "*", - "pear-pear.php.net/pear": "*", - "php": ">=5.0.0.0" - }, - "replace": { - "pear-pear/soap": "== 0.13.0.0" - }, - "type": "pear-library", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "PHP License" - ], - "description": "Implementation of SOAP protocol and services" - }, { "name": "pear-pear.php.net/Services_JSON", "version": "1.0.3", @@ -708,7 +559,7 @@ "keywords": [ "templating" ], - "time": "2016-12-14T21:57:25+00:00" + "time": "2016-12-14 21:57:25" } ], "packages-dev": [ @@ -769,7 +620,7 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2016-10-30 11:50:56" }, { "name": "codeception/codeception", @@ -864,7 +715,7 @@ "functional testing", "unit testing" ], - "time": "2017-08-10T20:28:02+00:00" + "time": "2017-08-10 20:28:02" }, { "name": "doctrine/instantiator", @@ -918,7 +769,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "facebook/webdriver", @@ -964,7 +815,7 @@ "selenium", "webdriver" ], - "time": "2016-08-10T00:44:08+00:00" + "time": "2016-08-10 00:44:08" }, { "name": "guzzle/guzzle", @@ -1060,7 +911,7 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2015-03-18 18:23:50" }, { "name": "guzzlehttp/guzzle", @@ -1112,7 +963,7 @@ "rest", "web service" ], - "time": "2016-07-15T19:28:39+00:00" + "time": "2016-07-15 19:28:39" }, { "name": "guzzlehttp/psr7", @@ -1177,7 +1028,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "guzzlehttp/ringphp", @@ -1228,7 +1079,7 @@ } ], "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "time": "2015-05-20T03:37:09+00:00" + "time": "2015-05-20 03:37:09" }, { "name": "guzzlehttp/streams", @@ -1278,7 +1129,7 @@ "Guzzle", "stream" ], - "time": "2014-10-12T19:18:40+00:00" + "time": "2014-10-12 19:18:40" }, { "name": "phpdocumentor/reflection-docblock", @@ -1327,7 +1178,7 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2016-01-25T08:17:30+00:00" + "time": "2016-01-25 08:17:30" }, { "name": "phpspec/prophecy", @@ -1390,7 +1241,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/php-code-coverage", @@ -1452,7 +1303,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -1499,7 +1350,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -1540,7 +1391,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -1589,7 +1440,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -1638,7 +1489,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", @@ -1710,7 +1561,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2017-06-21 08:07:12" }, { "name": "phpunit/phpunit-mock-objects", @@ -1766,7 +1617,7 @@ "mock", "xunit" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2015-10-02 06:51:40" }, { "name": "psr/http-message", @@ -1816,7 +1667,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -1863,7 +1714,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "react/promise", @@ -1909,7 +1760,7 @@ "promise", "promises" ], - "time": "2017-03-25T12:08:31+00:00" + "time": "2017-03-25 12:08:31" }, { "name": "satooshi/php-coveralls", @@ -1972,7 +1823,7 @@ "github", "test" ], - "time": "2015-12-28T09:07:32+00:00" + "time": "2015-12-28 09:07:32" }, { "name": "sebastian/comparator", @@ -2036,7 +1887,7 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -2088,7 +1939,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -2138,7 +1989,7 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", @@ -2205,7 +2056,7 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -2256,7 +2107,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", @@ -2309,7 +2160,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-10-03 07:41:43" }, { "name": "sebastian/version", @@ -2344,7 +2195,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2015-06-21 13:59:46" }, { "name": "stecman/symfony-console-completion", @@ -2389,7 +2240,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" + "time": "2016-02-24 05:08:54" }, { "name": "symfony/browser-kit", @@ -2446,7 +2297,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-12T12:59:33+00:00" + "time": "2017-07-12 12:59:33" }, { "name": "symfony/config", @@ -2502,7 +2353,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/console", @@ -2563,7 +2414,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-08-27T14:29:03+00:00" + "time": "2017-08-27 14:29:03" }, { "name": "symfony/css-selector", @@ -2616,7 +2467,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:31:55+00:00" + "time": "2017-05-01 14:31:55" }, { "name": "symfony/debug", @@ -2673,7 +2524,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-08-27T14:29:03+00:00" + "time": "2017-08-27 14:29:03" }, { "name": "symfony/dom-crawler", @@ -2729,7 +2580,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-08-15T13:30:53+00:00" + "time": "2017-08-15 13:30:53" }, { "name": "symfony/event-dispatcher", @@ -2789,7 +2640,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-02T07:47:27+00:00" + "time": "2017-06-02 07:47:27" }, { "name": "symfony/filesystem", @@ -2838,7 +2689,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-07-11T07:12:11+00:00" + "time": "2017-07-11 07:12:11" }, { "name": "symfony/finder", @@ -2887,7 +2738,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T20:52:29+00:00" + "time": "2017-06-01 20:52:29" }, { "name": "symfony/polyfill-mbstring", @@ -2946,7 +2797,7 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-06-14 15:44:48" }, { "name": "symfony/stopwatch", @@ -2995,7 +2846,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:07:15+00:00" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/yaml", @@ -3044,7 +2895,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-01T20:52:29+00:00" + "time": "2017-06-01 20:52:29" } ], "aliases": [ From 384ac2ce07d2aac9f8134b133cbb48b50d22154c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 15 Sep 2017 18:56:26 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fixed=20#145=20HTTP/Request=20=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E3=81=A8=E3=81=9D=E3=81=AE=E7=A2=BA?= =?UTF-8?q?=E8=AA=8D=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/module/HTTP/Request.php | 12 ++++++------ tests/class/module/HTTP/RequestTest.php | 16 +++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/data/module/HTTP/Request.php b/data/module/HTTP/Request.php index ef6109f22a..912096f85a 100644 --- a/data/module/HTTP/Request.php +++ b/data/module/HTTP/Request.php @@ -409,7 +409,7 @@ function reset($url, $params = array()) */ function setURL($url) { - $this->_url = &new Net_URL($url, $this->_useBrackets); + $this->_url = new Net_URL($url, $this->_useBrackets); if (!empty($this->_url->user) || !empty($this->_url->pass)) { $this->setBasicAuth($this->_url->user, $this->_url->pass); @@ -559,13 +559,13 @@ function addPostData($name, $value, $preencoded = false) $this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value); } } - + function addPostDataArray($array, $preencoded = false) { foreach($array as $key => $val){ $this->addPostData($key, $val, $preencoded); } - } + } /** * Recursively applies the callback function to the value @@ -740,7 +740,7 @@ function sendRequest($saveBody = true) $err = null; } else { $this->_notify('connect'); - $this->_sock =& new Net_Socket(); + $this->_sock = new Net_Socket(); $err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions); } PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest()); @@ -753,7 +753,7 @@ function sendRequest($saveBody = true) $this->_notify('sentRequest'); // Read the response - $this->_response = &new HTTP_Response($this->_sock, $this->_listeners); + $this->_response = new HTTP_Response($this->_sock, $this->_listeners); $err = $this->_response->process( $this->_saveBody && $saveBody, HTTP_REQUEST_METHOD_HEAD != $this->_method @@ -798,7 +798,7 @@ function sendRequest($saveBody = true) // Absolute URL if (preg_match('/^https?:\/\//i', $redirect)) { - $this->_url = &new Net_URL($redirect); + $this->_url = new Net_URL($redirect); $this->addHeader('Host', $this->_generateHostHeader()); // Absolute path } elseif ($redirect{0} == '/') { diff --git a/tests/class/module/HTTP/RequestTest.php b/tests/class/module/HTTP/RequestTest.php index 095655bf78..b0960c5c5c 100644 --- a/tests/class/module/HTTP/RequestTest.php +++ b/tests/class/module/HTTP/RequestTest.php @@ -1,31 +1,25 @@ * @license */ class HTTP_RequestTest extends Common_TestCase { - public function testConstructorSetsDefaults() { - $url = new Net_URL('http://www.example.com/foo'); - $req = new HTTP_Request(); - $req->setMethod(HTTP_REQUEST_METHOD_POST); - $req->addPostData('Foo', 'bar'); + $url = 'http://www.example.com/foo'; + $req = new HTTP_Request($url); + //$req->setMethod(HTTP_REQUEST_METHOD_POST); + //$req->addPostData('Foo', 'bar'); $this->assertSame($url, $req->getUrl()); - $this->assertEquals(HTTP_REQUEST_METHOD_POST, $req->getMethod()); + //$this->assertEquals(HTTP_REQUEST_METHOD_POST, $req->getMethod()); } }