Documentation
-------------
+
+*NB: the user manual has not been updated yet with all the changes made in version 4. Please consider it unreliable!*
+
+*You are encouraged to look instead the code examples found in the demo/ directory*
+
The user manual can be found in the doc/manual directory, in Asciidoc format: [phpxmlrpc_manual.adoc](doc/manual/phpxmlrpc_manual.adoc)
Release tarballs also contain the HTML and PDF versions, as well as an automatically generated API documentation.
-*NB: the user manual has not been updated yet with all the changes made in version 4. Please consider it unreliable!*
-
Upgrading
---------
-If you are upgrading from version 3 or earlier, please read the docs in [doc/api_changes_v4.md](doc/api_changes_v4.md)
+If you are upgrading from version 3 or earlier you have two options:
+
+1. adapt your code to the new API (all changes needed are described in [doc/api_changes_v4.md](doc/api_changes_v4.md))
+
+2. use instead the *compatibility layer* which is provided. Instructions and pitfalls described in [doc/api_changes_v4.md](doc/api_changes_v4.md##enabling-compatibility-with-legacy-code)
+
+In any case, read carefully the docs in [doc/api_changes_v4.md](doc/api_changes_v4.md) and report back any undocumented
+issue using GitHub.
License
-------
library classes available.
Instead, it is recommended to rely on class autoloading.
-
-* If you are using Composer, just install the library by declaring it as dependency for your project in composer.json
+
+* If you are using Composer, just install the library by declaring it as dependency for your project in composer.json
"require": {
...,
"phpxmlrpc/phpxmlrpc": "~4.0"
},
-
+
* If you do not use Composer, an autoloader for the library can be found in src/Atuloader.php.
The php example files in the demo/client folder do make use of it.
Example code to set up the autoloader:
-
+
include_once <path to library> . "/src/Autoloader.php";
PhpXmlRpc\Autoloader::register();
----------------
All classes have ben renamed, are now properly namespaced and follow the CamelCase naming convention.
-Existing class methods and members have been preserved; all new method names follow camelCase.
+Existing class methods and members have been preserved; all new method names follow camelCase.
Conversion table:
* when serialize() is invoked on a response and its payload can not be serialized, an exception is thrown instead of
ending all execution
-* all error messages now mention the class and method which generated name
+* all error messages now mention the class and method which generated them
-* all library source code has been moved to the src/ directory
+* all library source code has been moved to the src/ directory
* all source code has been reformatted according to modern PSR standards
### Usage of global variables
* ALL global variables which existed after including xmlrpc.inc in version 3 still do exist after including it in v. 4
-
+
* Code which relies on using (as in 'reading') their value will keep working unchanged
* Changing the value of some of those variables does not have any effect anymore on library operation.
$GLOBALS['xmlrpc_null_apache_encoding'] = true;
// new line needed now
PhpXmlRpc\PhpXmlRpc::importGlobals();
-
+
Alternative solution:
-
+
include('xmlrpc.inc');
PhpXmlRpc\PhpXmlRpc::$xmlrpc_null_apache_encoding = true;
instances will return the new classes.
Example:
-
+
is_a(php_xmlrpc_encode('hello world'), 'xmlrpcval') => false
is_a(php_xmlrpc_encode('hello world'), 'PhpXmlRpc\Value') => true