From bd7691e889d49399d96dbef60395c679732bb4ee Mon Sep 17 00:00:00 2001 From: gggeek Date: Mon, 30 Jan 2023 22:51:04 +0000 Subject: [PATCH] more deprecation logging --- src/Client.php | 14 ++++++++++++++ src/Helper/XMLParser.php | 5 +++-- src/Wrapper.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index da15e656..775fe232 100644 --- a/src/Client.php +++ b/src/Client.php @@ -726,6 +726,8 @@ class Client */ public function setSSLVerifyPeer($i) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->verifypeer = $i; return $this; } @@ -741,6 +743,8 @@ class Client */ public function setSSLVerifyHost($i) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->verifyhost = $i; return $this; } @@ -754,6 +758,8 @@ class Client */ public function setSSLVersion($i) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->sslversion = $i; return $this; } @@ -817,6 +823,8 @@ class Client */ public function setRequestCompression($compMethod) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->request_compression = $compMethod; return $this; } @@ -866,6 +874,8 @@ class Client */ public function setCurlOptions($options) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->extracurlopts = $options; return $this; } @@ -877,6 +887,8 @@ class Client */ public function setUseCurl($useCurlMode) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->use_curl = $useCurlMode; return $this; } @@ -893,6 +905,8 @@ class Client */ public function setUserAgent($agentString) { + $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); + $this->user_agent = $agentString; return $this; } diff --git a/src/Helper/XMLParser.php b/src/Helper/XMLParser.php index 4e2d1878..efba3383 100644 --- a/src/Helper/XMLParser.php +++ b/src/Helper/XMLParser.php @@ -317,7 +317,7 @@ class XMLParser if ($acceptSingleVals === false) { $accept = $this->current_parsing_options['accept']; } else { - //trigger_error('using argument $acceptSingleVals is deprecated', E_USER_DEPRECATED); + $this->logDeprecation('Using argument $acceptSingleVals for method ' . __METHOD__ . ' is deprecated'); $accept = self::ACCEPT_REQUEST | self::ACCEPT_RESPONSE | self::ACCEPT_VALUE; } if (($name == 'METHODCALL' && ($accept & self::ACCEPT_REQUEST)) || @@ -489,7 +489,8 @@ class XMLParser */ public function xmlrpc_se_any($parser, $name, $attrs) { - //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + // avoid spamming the log with warnings in case this is in use... + //$this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); $this->xmlrpc_se($parser, $name, $attrs, true); } diff --git a/src/Wrapper.php b/src/Wrapper.php index b1013c2e..4ede26e9 100644 --- a/src/Wrapper.php +++ b/src/Wrapper.php @@ -160,7 +160,7 @@ class Wrapper * @todo decide how to deal with params passed by ref in function definition: bomb out or allow? * @todo finish using phpdoc info to build method sig if all params are named but out of order * @todo add a check for params of 'resource' type - * @todo add some trigger_errors / error_log when returning false? + * @todo add some error logging when returning false? * @todo what to do when the PHP function returns NULL? We are currently returning an empty string value... * @todo add an option to suppress php warnings in invocation of user function, similar to server debug level 3? * @todo add a verbatim_object_copy parameter to allow avoiding usage the same obj instance? -- 2.47.0