PHP code example of leblanc-simon / openerpbyxmlrpc

1. Go to this page and download the library: Download leblanc-simon/openerpbyxmlrpc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leblanc-simon / openerpbyxmlrpc example snippets


use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use OpenErpByXmlRpc\OpenErpByXmlRpc;

// Configure Logger (if you want log request and response)
$logger = new Logger('xmlrpc');
$handler = new StreamHandler(__DIR__.'/logs/xmlrpc-'.date('Ymd').'.log', Logger::DEBUG);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true));
$logger->pushHandler($handler);

// Init the communication
$xmlrpc = new OpenErpByXmlRpc('localhost', 8069, 'database', 'username', 'password');
$xmlrpc->setLogger($logger); // Not