first of all, I have no idea how to in PHP, below is a requirement so i have to do this ( off course this will encourage me to come in world of PHP, Laravel etc. )
we have an ubuntu 18.04 desktop VM (using vmware workstation), installed Odoo 14, here all things working fine.
on windows host machine we have portable version of xampp 7.2.34, we want to access Odoo database using ripcord library (as per official examples in their documentations), i downloaded it from github and copied in my project folder, here i created a .php file (code below) and run in chrome browser which throws error that ripcord.php file not found. secondly, i tried to install it through "composer" and tried again but still same error, also have enable xmlrpc in php.ini and it shows me when i run and check that xmlrpc is there:
- Code: Select all
<?php var_dump(get_loaded_extensions()) ?>
and
- Code: Select all
<?php phpinfo() ?>
my .php code to connect and access odoo database:
- Code: Select all
<?php
$url = "http://192.168.18.71:8069/";
$db = 'odb14';
$username = 'myemail@mail.com';
$password = 'admin';
require_once('ripcord.php');
$common = ripcord::client($url.'/xmlrpc/2/common');
$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client("$url/xmlrpc/2/object");
$partners = $models->execute_kw(
$db,
$uid,
$password,
'res.partner',
'search',
array(
array(
array('is_company', '=', true),
array('customer', '=', true)
)
)
);
echo($uid);
echo('RESULT:<br/>');
foreach ($partners as $partner) {
echo $partner.'<br/>';
}
?>
last error it is showing in browser:
Warning: require_once(ripcord.php): failed to open stream: No such file or directory in D:\xampp\htdocs\faaizyapi\test2.php on line 10
Fatal error: require_once(): Failed opening required 'ripcord\ripcord.php' (include_path='\xampp\php\pear\PEAR') in D:\xampp\htdocs\faaizyapi\test2.php on line 10
please help to solve the problem while keeping in mind that it is my first attempt to use PHP and if it is same in Laravel then it will be much easier/handy for me.
regards