X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=INSTALL;h=b016c13b863a783fc20eebfd536639ee87bf5f93;hb=8e7f7c3cd2daa0c63b3b54b83caad271e1feb31c;hp=87ac01399ce31830abcad8708403ba461b757fcf;hpb=1978b0db7ae600aac35a7e5527a26a741e33dc3c;p=plcapi.git diff --git a/INSTALL b/INSTALL index 87ac013..b016c13 100644 --- a/INSTALL +++ b/INSTALL @@ -1,38 +1,82 @@ -XMLRPC for PHP - -Requirements ------------- - -The following requirements should be met prior to using 'XMLRPC for PHP': -. PHP 5.0 or later; 5.0.3 or later recommended to have all functionality enabled -. the php "curl" extension is needed if you wish to use SSL or HTTP 1.1 to - communicate with remote servers - -The php "xmlrpc" native extension is not required, but if it is installed, -there will be no interference with the operation of this library. - - -Installation instructions -------------------------- - -Installation of the library is quite easy: - -1. copy the contents of the lib/ folder to any location required by your - application (it can be inside the web server root or not). - -2. make sure your app can include those files. This can be achieved by setting - the PHP include path, either in the php.ini file or directly in the php code - of your application, using the 'set_include_path' function - - -Example of php code allowing an application to import the library: - -set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/phpxmlrpc/lib/'); -require_once( 'xmlrpc.inc' ); -require_once( 'xmlrpcs.inc' ); -require_once( 'xmlrpc_wrappers.inc' ); - - -Please note that usage of the 'make' command for installation of the library is -not recommended, as it will generally involve editing of the makefile for a -succesfull run. +XMLRPC for PHP + +Requirements +------------ + +The following requirements should be met prior to using 'XMLRPC for PHP': +. PHP 5.3.0 or later +. the php "curl" extension is needed if you wish to use SSL or HTTP 1.1 to + communicate with remote servers + +The php "xmlrpc" native extension is not required, but if it is installed, +there will be no interference with the operation of this library. + + +Installation instructions +------------------------- + +Installation of the library is quite easy: + +1. Via Composer (highly recommended): + + 1. Install composer if you don't have it already present on your system. + Depending on how you install, you may end up with a composer.phar file in your directory. + In that case, no worries! Just substitute 'php composer.phar' for 'composer' in the commands below. + + 2. If you're creating a new project, create a new empty directory for it. + + 3. Open a terminal and use Composer to grab the library. + + $ composer require phpxmlrpc/phpxmlrpc:4.0 + + 4. Write your code. + Once Composer has downloaded the component(s), all you need to do is include the vendor/autoload.php file that + was generated by Composer. This file takes care of autoloading all of the libraries so that you can use them + immediately, including phpxmlrpc: + + // File example: src/script.php + + // update this to the path to the "vendor/" directory, relative to this file + require_once __DIR__.'/../vendor/autoload.php'; + + use PhpXmlRpc\Value; + use PhpXmlRpc\Request; + use PhpXmlRpc\Client; + + $client = new Client('http://some/server'); + $response = $client->send(new Request('method', array(new Value('parameter')))); + + 5. IMPORTANT! Make sure that the vendor/phpxmlrpc directory is not directly accessible from the internet, + as leaving it open to access means that any visitor can trigger execution of php code such as + the built-in debugger. + + +2. Via manual download and autoload configuration + + 1. copy the contents of the src/ folder to any location required by your + application (it can be inside the web server root or not). + + 2. configure your app autoloading mechanism so that all classes in the PhpXmlRpc namespace are loaded + from that location (any PSR-4 compliant autoloader can do that) + + 3. Write your code. + + // File example: script.php + + require_once __DIR__.'my_autoloader.php'; + + use PhpXmlRpc\Value; + use PhpXmlRpc\Request; + use PhpXmlRpc\Client; + + $client = new Client('http://some/server'); + $response = $client->send(new Request('method', array(new Value('parameter')))); + + 5. IMPORTANT! Make sure that the vendor/phpxmlrpc directory is not directly accessible from the internet, + as leaving it open to access means that any visitor can trigger execution of php code such as + the built-in debugger. + + +Please note that usage of the 'make' command for installation of the library is +not recommended, as it will generally involve editing of the makefile for a +successful run.