diff options
author | Alexei Vladishev <alexei.vladishev@zabbix.com> | 2015-05-24 15:07:54 +0300 |
---|---|---|
committer | Alexei Vladishev <alexei.vladishev@zabbix.com> | 2015-05-24 15:07:54 +0300 |
commit | fa5edf47fd539aed2eb2a0eaf83cdf7e5fd7f6fd (patch) | |
tree | 947a4d92cb2128ebf9acd8050e73e719ff8f6b51 /misc | |
parent | 99e65140b0a91ad06cdd7ad90b46d79d9e8d8fe2 (diff) |
..F....... [ZBXNEXT-2662] older syntax array() replaced with shorter using [ and ]
Diffstat (limited to 'misc')
-rw-r--r-- | misc/jsonrpctool/api.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/misc/jsonrpctool/api.php b/misc/jsonrpctool/api.php index 1fc729663b8..e540a9b2e60 100644 --- a/misc/jsonrpctool/api.php +++ b/misc/jsonrpctool/api.php @@ -9,13 +9,13 @@ function do_post_request($url, $data){ $header .= "Content-Length: ".strlen($data)."\r\n"; $header .= "\r\n"; - $params = array( - 'http' => array( + $params = [ + 'http' => [ 'method' => 'post', 'content' => $data, 'header' => $header, - ) - ); + ] + ]; $ctx = stream_context_create($params); @@ -69,12 +69,12 @@ function do_post_request($url, $data){ <?php if(isset($_REQUEST['apicall'])){ - $data = array( + $data = [ 'jsonrpc' => '2.0', 'method' => 'user.login', - 'params' => array('user'=>$user, 'password'=>$pswd), + 'params' => ['user'=>$user, 'password'=>$pswd], 'id'=> 1 - ); + ]; $data = json_encode($data); @@ -96,13 +96,13 @@ if(isset($_REQUEST['apicall'])){ </div> <?php - $data = array( + $data = [ 'jsonrpc' => '2.0', 'method' => $_REQUEST['apimethod'], 'params' => json_decode($_REQUEST['apiparams'], true), 'auth' => $auth, 'id'=> 2 - ); + ]; $data = json_encode($data); $response = do_post_request($url, $data); ?> |