diff options
author | Christian Schneider | 2015-02-10 16:31:38 +0100 |
---|---|---|
committer | Christian Schneider | 2015-02-10 16:31:38 +0100 |
commit | 63ec357b2f300c48d4c90d7d6209b964c2caa3dd (patch) | |
tree | 6cade258a1c0c9362a5931a0dbc6a8c51d33812d /it_url.class | |
parent | 9e350531328e67bd5b0c0425f1a2619a08456f6e (diff) | |
download | itools-63ec357b2f300c48d4c90d7d6209b964c2caa3dd.tar.gz itools-63ec357b2f300c48d4c90d7d6209b964c2caa3dd.tar.bz2 itools-63ec357b2f300c48d4c90d7d6209b964c2caa3dd.zip |
Make ITools standard PHP 5.3 compatible (syntax patch, no short array syntax)
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/it_url.class b/it_url.class index c605c91..b9bb17c 100644 --- a/it_url.class +++ b/it_url.class @@ -243,7 +243,7 @@ function get($p=null, $timeout=5) $p = array('url' => $p, 'timeout' => $timeout); $p += array('retries' => 1); - if (($filter = EDC('req')) && strstr($p['url'], it::replace('1' => ":", $filter))) + if (($filter = EDC('req')) && strstr($p['url'], it::replace(array('1' => ":", $filter)))) ED($p['url']); if ($this instanceof it_url) @@ -271,7 +271,7 @@ function get($p=null, $timeout=5) if (!$result && $p['retries'] > 0 && $url->result < 400) $result = $url->get(array('retries' => $p['retries'] - 1) + $p); - if (($filter = EDC('res')) && strstr($p['url'], it::replace('1' => ":", $filter))) + if (($filter = EDC('res')) && strstr($p['url'], it::replace(array('1' => ":", $filter)))) ED($result); return $result; @@ -402,14 +402,14 @@ static function curl_opts($p=array()) if ($p['maxlength']) { $maxlength = $p['maxlength']; - $add = [ + $add = array( #CURLOPT_BUFFERSIZE => 1024 * 1024 * 10, CURLOPT_NOPROGRESS => false, CURLOPT_PROGRESSFUNCTION => function ($dummy0, $dummy1, $size, $dummy2, $dummy3) use ($maxlength) { return $size < $maxlength ? 0 : 1; }, - ]; + ); } - return (array)$add + [ + return (array)$add + array( CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => $p['totaltimeout'], @@ -425,7 +425,7 @@ static function curl_opts($p=array()) CURLOPT_SSL_VERIFYHOST => 2, CURLINFO_HEADER_OUT => 1, - ]; + ); } /* @@ -443,7 +443,7 @@ function request_curl($p=array()) if ($p['url']) $this->it_url($p['url']); - $url->headers = []; + $url->headers = array(); $p['headers'] = (array)$p['headers'] + array( 'Host' => $url->realhostname . $url->explicitport, @@ -451,7 +451,7 @@ function request_curl($p=array()) 'Accept-Language' => T_lang(), ); - $opts = [CURLOPT_FOLLOWLOCATION => false, CURLOPT_HEADER => 1] + self::curl_opts($p); + $opts = array(CURLOPT_FOLLOWLOCATION => false, CURLOPT_HEADER => 1) + self::curl_opts($p); $curl = curl_init($url->rawurl); curl_setopt_array($curl, $opts); @@ -499,7 +499,7 @@ function get_multi($p=null) 'Accept-Language' => T_lang(), ); - $opts = [CURLOPT_FOLLOWLOCATION => true] + self::curl_opts($p); + $opts = array(CURLOPT_FOLLOWLOCATION => true) + self::curl_opts($p); $mh = curl_multi_init(); |