Skip to content

Commit

Permalink
#839 getRemoteResource 에서 연결 설정을 수정할 수 있도록 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
akasima committed Jul 21, 2014
1 parent b85b7b1 commit 66a2440
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion classes/file/FileHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ function filesize($size)
* @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
{
Expand All @@ -533,6 +533,15 @@ function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $c
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)
Expand Down

0 comments on commit 66a2440

Please sign in to comment.