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 | |
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)
-rw-r--r-- | it.class | 4 | ||||
-rw-r--r-- | it_url.class | 18 | ||||
-rw-r--r-- | itjs.class | 2 |
3 files changed, 12 insertions, 12 deletions
@@ -622,7 +622,7 @@ static function _exec_quotevalue($value, $errmsg = "") */ static function cexec(/* $cmd, $values1 = array(), ... */) { - return it::exec('cdist -c {CMD}', 'CMD' => call_user_func_array('it::shell_command', func_get_args())); + return it::exec('cdist -c {CMD}', array('CMD' => call_user_func_array('it::shell_command', func_get_args()))); } @@ -636,7 +636,7 @@ static function cdist(/* $file1, ... */) foreach (func_get_args() as $arg) $files = array_merge((array)$files, (array)$arg); - return it::exec('cdist {FILES}', 'FILES' => $files); + return it::exec('cdist {FILES}', array('FILES' => $files)); } 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(); @@ -211,7 +211,7 @@ function crcurl($url) else $fn = ($m = it::match("^//(\w+)(/.*)", $url)) ? "/www/$m[0].search.ch" . $m[1] : $GLOBALS['ULTRAHOME'] . $url; - return it::match('#', $url) ? U(trim($url, "#")) : U($url, array('c' => self::checksum([$fn]))); + return it::match('#', $url) ? U(trim($url, "#")) : U($url, array('c' => self::checksum(array($fn)))); } } |