Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAlexei Vladishev <alexei.vladishev@zabbix.com>2015-05-24 15:07:54 +0300
committerAlexei Vladishev <alexei.vladishev@zabbix.com>2015-05-24 15:07:54 +0300
commitfa5edf47fd539aed2eb2a0eaf83cdf7e5fd7f6fd (patch)
tree947a4d92cb2128ebf9acd8050e73e719ff8f6b51 /misc
parent99e65140b0a91ad06cdd7ad90b46d79d9e8d8fe2 (diff)
..F....... [ZBXNEXT-2662] older syntax array() replaced with shorter using [ and ]
Diffstat (limited to 'misc')
-rw-r--r--misc/jsonrpctool/api.php18
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);
?>