1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Added ability to log all external API calls by setting user.debug = 1

This commit is contained in:
Jon Ziebell 2020-02-13 07:34:53 -05:00
parent ac121dcb74
commit 786b958086

View File

@ -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);