* new: it is now possible to inject a custom logger into helper classes `Charset`, `Http`, `XMLParser`, inching a step
closer to supporting DIC patterns
+* new: method `PhpXmlRpc::setLogger()`, to simplify injecting the logger into all classes of the library in one step
+
* new: passing value -1 to `$client->setDebug` will avoid storing the full http response data in the returned Response
object when executing `call`. This could be useful in reducing memory usage for big responses
use PhpXmlRpc\Client;
use PhpXmlRpc\Encoder;
-use PhpXmlRpc\Helper\Charset;
-use PhpXmlRpc\Helper\Http;
-use PhpXmlRpc\Helper\XMLParser;
+use PhpXmlRpc\PhpXmlRpc;
use PhpXmlRpc\Request;
// Definition of a custom logger implementing the same API as the default one
// inject it into all the classes (possibly) involved
-Charset::setLogger($logger);
-Client::setLogger($logger);
-Encoder::setLogger($logger);
-Http::setLogger($logger);
-Request::setLogger($logger);
-XMLParser::setLogger($logger);
+PhpXmlRpc::setLogger($logger);
// then send a request
namespace PhpXmlRpc;
use PhpXmlRpc\Helper\Charset;
+use PhpXmlRpc\Helper\Http;
+use PhpXmlRpc\Helper\XMLParser;
/**
* Manages global configuration for operation of the library.
}
}
}
+
+ /**
+ * Inject a logger into all classes of the PhpXmlRpc library which use one
+ *
+ * @param $logger
+ * @return void
+ */
+ public static function setLogger($logger)
+ {
+ Charset::setLogger($logger);
+ Client::setLogger($logger);
+ Encoder::setLogger($logger);
+ Http::setLogger($logger);
+ Request::setLogger($logger);
+ Server::setLogger($logger);
+ Value::setLogger($logger);
+ Wrapper::setLogger($logger);
+ XMLParser::setLogger($logger);
+ }
}