mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 02:10:02 +09:00
merge from branch luminous (version 1.5.4.2, ~r12561)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@12611 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2263200ce4
commit
cc47d2b247
196 changed files with 3655 additions and 2033 deletions
|
|
@ -370,6 +370,32 @@ class FileHandler {
|
|||
* @return string If success, the content of the target file. Otherwise: none
|
||||
**/
|
||||
function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array()) {
|
||||
if(version_compare(PHP_VERSION, '5.0.0', '>='))
|
||||
{
|
||||
return include _XE_PATH_ . 'classes/file/getRemoteResourcePHP5.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
return FileHandler::_getRemoteResource($url, $boyd, $timeout, $mehtod, $conent_type, $headers, $cookies, $post_data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return remote file's content via HTTP
|
||||
*
|
||||
* If the target is moved (when return code is 300~399), this function follows the location specified response header.
|
||||
*
|
||||
* @param string $url The address of the target file
|
||||
* @param string $body HTTP request body
|
||||
* @param int $timeout Connection timeout
|
||||
* @param string $method GET/POST
|
||||
* @param string $content_type Content type header of HTTP request
|
||||
* @param string[] $headers Headers key vaule array.
|
||||
* @param string[] $cookies Cookies key value array.
|
||||
* @param string $post_data Request arguments array for POST method
|
||||
* @return string If success, the content of the target file. Otherwise: none
|
||||
**/
|
||||
function _getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array()) {
|
||||
requirePear();
|
||||
require_once('HTTP/Request.php');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue