|
@@ -10,7 +10,7 @@ class Platform
|
|
|
public $info;
|
|
|
public $field;
|
|
|
|
|
|
- public function setting($id, $field = array())
|
|
|
+ public function setting($id, $field = [])
|
|
|
{
|
|
|
$this->info($id);
|
|
|
$this->platform();
|
|
@@ -46,7 +46,7 @@ class Platform
|
|
|
if (isset($field['account_project']) && isset($field['account_id'])) {
|
|
|
$this->info['account_id'] = $field['account_id'];
|
|
|
$this->info['account_project'] = $field['account_project'];
|
|
|
- $setting = Dever::db('account_setting', $field['account_project'])->select(array('account_id' => $field['account_id']));
|
|
|
+ $setting = Dever::db('account_setting', $field['account_project'])->select(['account_id' => $field['account_id']]);
|
|
|
if ($setting) {
|
|
|
foreach ($setting as $k => $v) {
|
|
|
$info = Dever::db('platform_setting', 'api')->find($v['platform_setting_id']);
|
|
@@ -69,7 +69,7 @@ class Platform
|
|
|
$this->field->setUri($this->info['uri']);
|
|
|
$this->field->setNotify($this->createNotify($field));
|
|
|
|
|
|
- $setting = Dever::db('api_setting', 'api')->select(array('api_id' => $this->info['id']));
|
|
|
+ $setting = Dever::db('api_setting', 'api')->select(['api_id' => $this->info['id']]);
|
|
|
if ($setting) {
|
|
|
foreach ($setting as $k => $v) {
|
|
|
$this->field->set($v['key'], $this->field->value($v['value'], $v['type']));
|
|
@@ -94,10 +94,10 @@ class Platform
|
|
|
$curl->setResultHeader(true);
|
|
|
$response_body = $curl->result();
|
|
|
$response_header = $curl->header();
|
|
|
- $response_config = array('id' => $this->platform['id'], 'type' => $this->platform['response_type']);
|
|
|
+ $response_config = ['id' => $this->platform['id'], 'type' => $this->platform['response_type']];
|
|
|
$response = new Response($response_body, $response_header, $this->field, $response_config, $this->type, $this->info['id']);
|
|
|
$result = $response->out();
|
|
|
- $log = array();
|
|
|
+ $log = [];
|
|
|
$log['platform_id'] = $this->platform['id'];
|
|
|
$log['api_id'] = $this->info['id'];
|
|
|
$log['account_id'] = $this->info['account_id'];
|
|
@@ -155,9 +155,9 @@ class Platform
|
|
|
if (strstr($this->info['uri'], 'http')) {
|
|
|
$this->platform['host'] = '';
|
|
|
}
|
|
|
- $path = Dever::db('api_path', 'api')->select(array('api_id' => $this->info['id']));
|
|
|
+ $path = Dever::db('api_path', 'api')->select(['api_id' => $this->info['id']]);
|
|
|
if ($path) {
|
|
|
- $path = array();
|
|
|
+ $path = [];
|
|
|
foreach ($path as $k => $v) {
|
|
|
$v['value'] = $this->field->value($v['value']);
|
|
|
if ($v['type'] == 1) {
|
|
@@ -175,9 +175,9 @@ class Platform
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $query = Dever::db('api_query', 'api')->select(array('api_id' => $this->info['id']));
|
|
|
+ $query = Dever::db('api_query', 'api')->select(['api_id' => $this->info['id']]);
|
|
|
if ($query) {
|
|
|
- $param = array();
|
|
|
+ $param = [];
|
|
|
foreach ($query as $k => $v) {
|
|
|
$param[$v['key']] = $this->field->value($v['value'], $v['type']);
|
|
|
if (is_array($param[$v['key']])) {
|