Download the PHP package odxproxy/client without Composer
On this page you can find all versions of the php package odxproxy/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download odxproxy/client
More information about odxproxy/client
Files in odxproxy/client
Package client
Short Description High performance PHP client for ODXProxy
License MIT
Informations about the package client
ODXProxy Client for PHP
A high-performance, low-footprint, zero-dependency PHP client for interacting with Odoo instances via the ODXProxy Gateway. This library is designed to be lightweight (using native curl and json extensions only) while maintaining strict type safety and security.
Requirements
- PHP >= 8.1
- Extensions: ext-curl, ext-json
Installation
Quick Start (Global Initialization)
Similar to the Android SDK, you can initialize the client once (e.g., in your index.php, bootstrap.php, or Laravel AppServiceProvider). This sets up a Request-Scoped Singleton that allows you to access the API anywhere in your code without passing configuration arrays around.
Usage Guide
1. Reading Data
searchRead
Combines searching and reading in one optimized call.
searchCount
Get the number of records matching a domain.
read
Read specific fields from specific IDs.
2. Writing Data
create
Creates a new record and returns the created ID (or record data depending on context).
write
Updates existing records.
unlink (Delete)
Deletes records.
- Calling Methods (RPC) Call any public method on an Odoo model.
Advanced Usage
Pagination & Filtering (KeywordRequest)
Use the KeywordRequest helper to handle offset, limit, order, and fields (projection). This allows you to construct queries fluently.
Multi-User / SaaS Support (Odx::with) In Android, the device usually belongs to one user. In PHP, your server might handle requests for hundreds of different Odoo instances (Multi-tenancy). Do not use Odx::init() inside a loop, as it changes the global state. Instead, use Odx::with() to create a temporary, disposable client.
Error Handling
The library throws OdxProxy\Exception\OdxException for both Network errors (Curl) and Odoo Server errors (XML-RPC/JSON-RPC faults).
Helper Classes Reference
OdxProxy\Model\KeywordRequest
| Method | Description |
|---|---|
| setLimit(int) | Max records to return |
| setOffset(int) | Number of records to skip |
| setOrder(string) | Sort order (e.g., 'id desc') |
| setFields(array) | List of fields to return (SQL SELECT) |
| resetPagination() | Returns a copy of the request with |
| limit/offset | cleared |
OdxProxy\Utils\IdHelper
| Method | Description |
|---|---|
| generate() | Generates a 13-byte random ID (similar to ULID) for request tracking |
| normalizeId($val) | Robustly converts Odoo responses (which can be [id, name] or false) into a safe ID string or null. |
License MIT
All versions of client with dependencies
ext-curl Version *
ext-json Version *