#839 getRemoteResource 에서 연결 설정을 수정할 수 있도록 처리

This commit is contained in:
akasima 2014-07-11 10:47:50 +09:00
parent b85b7b18e0
commit 66a2440daa

View file

@ -515,7 +515,7 @@ class FileHandler
* @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())
function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array(), $request_config = array())
{
try
{
@ -533,6 +533,15 @@ class FileHandler
else
{
$oRequest = new HTTP_Request($url);
if(count($request_config) && method_exists($oRequest, 'setConfig'))
{
foreach($request_config as $key=>$val)
{
$oRequest->setConfig($key, $val);
}
}
if(count($headers) > 0)
{
foreach($headers as $key => $val)