定制 diolcos/odoo-api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

diolcos/odoo-api-client

Composer 安装命令:

composer require diolcos/odoo-api-client

包简介

A simple XML-RPC wrapper library for Odoo. For the time being, only a very limited set of Odoo API calls is exposed.

README 文档

README

A simple XML-RPC wrapper library for Odoo. For the time being, only a very limited set of Odoo API calls is exposed.

Installation via Composer

The recommended method to install Odoo API Client is through Composer.

  1. Add diolcos/odoo-api-client as a dependency in your project's composer.json:

        {
            "require": {
                "diolcos/odoo-api-client": "~0.1"
            }
        }
  2. Download and install Composer:

        curl -s http://getcomposer.org/installer | php
  3. Install your dependencies:

        php composer.phar install --no-dev
  4. Require Composer's autoloader

    Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:

    <?php
    
    use OdooApiClient\XmlRpcApiWrapper as OdooXmlRpcApiWrapper;
    
    require_once 'vendor/autoload.php';

You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.

You'll notice that the installation command specified --no-dev. This prevents Composer from installing the various testing and development dependencies. For average users, there is no need to install the test suite. If you wish to contribute to development, just omit the --no-dev flag to be able to run tests.

Example

<?php

use OdooApiClient\XmlRpcApiWrapper as OdooXmlRpcApiWrapper;
use OdooApiClient\Entities\Contacts as OdooContacts;

require_once 'vendor/autoload.php';

$odooApiWrapper = new OdooXmlRpcApiWrapper([
    'url'       => "http://odoo.my.site",
    'db'        => "my_odoo_db",
    'username'  => "myuser@example.com",
    'password'  => "example_password",
]);

$odooContacts = new OdooContacts($odooApiWrapper);
$contacts = $odooContacts->list();

print_r($contacts);

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2020-02-12