{
protected $debugBuffer = '';
protected $errorBuffer = '';
+ protected $warningBuffer = '';
// logger API
public function debug($message, $context = array())
$this->debugBuffer .= $message . "\n";
}
- // logger API
public function error($message, $context = array())
{
$this->errorBuffer .= $message . "\n";
}
+ public function warning($message, $context = array())
+ {
+ $this->warningBuffer .= $message . "\n";
+ }
+
public function getDebug()
{
return $this->debugBuffer;
{
return $this->errorBuffer;
}
+
+ public function getWarning()
+ {
+ return $this->warningBuffer;
+ }
}
// create the custom logger instance
$encoder = new Encoder();
$client = new Client(XMLRPCSERVER);
+// enable warnings for use of deprecated features
+PhpXmlRpc::$xmlrpc_silence_deprecations = false;
+
// set maximum debug level, to have all the communication details logged
$client->setDebug(2);
output("Response received.<br>");
output("The client error info is:<pre>\n" . $logger->getError() . "\n</pre>");
+output("The client warning info is:<pre>\n" . $logger->getWarning() . "\n</pre>");
output("The client debug info is:<pre>\n" . $logger->getDebug() . "\n</pre>");
$client = new Client(XMLRPCSERVER);
// to support http redirects we have to force usage of cURL even for http 1.0 requests
-$client->setUseCurl(Client::USE_CURL_ALWAYS);
-$client->setCurlOptions(array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_POSTREDIR => 3));
+$client->setOption(Client::OPT_USE_CURL, Client::USE_CURL_ALWAYS);
+$client->setOption(Client::OPT_EXTRA_CURL_OPTS, array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_POSTREDIR => 3));
// if we know that the server supports them, we can enable sending of compressed requests
-$client->setRequestCompression('gzip');
+$client->setOption(Client::OPT_REQUEST_COMPRESSION, 'gzip');
// ask the client to give us back xml
$client->setOption(Client::OPT_RETURN_TYPE, 'xml');