From 786b958086a00667d3130f99f6328a227e605bb3 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Thu, 13 Feb 2020 07:34:53 -0500 Subject: [PATCH] Added ability to log all external API calls by setting user.debug = 1 --- api/external_api.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/external_api.php b/api/external_api.php index a57bbca..84c4983 100644 --- a/api/external_api.php +++ b/api/external_api.php @@ -53,6 +53,11 @@ class external_api extends cora\api { * @return string Result on success, false on failure. */ protected function curl($arguments) { + $user = $this->api('user', 'get', $this->session->get_user_id()); + if ($user['debug'] === true) { + $this::$log_mysql = 'all'; + } + $this->request_timestamp = time(); $this->request_timestamp_microtime = $this->microtime(); @@ -61,7 +66,6 @@ class external_api extends cora\api { curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($curl_handle, CURLOPT_TIMEOUT, 60); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true); - // curl_setopt($curl_handle, CURLOPT_HEADER, true); if(isset($arguments['method']) === true && $arguments['method'] === 'POST') { curl_setopt($curl_handle, CURLOPT_POST, true);