oihana / php-arango
Composable PHP toolkit for ArangoDB. Bundles a modern HTTP client (collections, documents, edges, AQL, cursors, indexes, transactions, graphs, analyzers, views), a high-level façade, document/edge models with trait-based composition, controllers, helpers and CLI commands.
Requires
- php: >=8.4
- ext-memcached: *
- casbin/casbin: ^4.0
- guzzlehttp/guzzle: ^7.10
- oihana/php-auth: dev-main
- oihana/php-commands: dev-main
- oihana/php-core: dev-main
- oihana/php-enums: dev-main
- oihana/php-exceptions: dev-main
- oihana/php-files: dev-main
- oihana/php-reflect: dev-main
- oihana/php-schema: dev-main
- oihana/php-signals: dev-main
- oihana/php-system: dev-main
- php-di/php-di: ^7.0
- psr/container: ^2.0
- psr/http-message: ^2.0
- psr/log: ^3.0
- symfony/console: ^7.0 || ^8.0
- symfony/uid: ^7.0 || ^8.0
Requires (Dev)
- nunomaduro/collision: ^8.8
- phpdocumentor/shim: ^3.8
- phpunit/phpunit: ^12
This package is auto-updated.
Last update: 2026-05-26 09:14:08 UTC
README
Composable PHP toolkit for ArangoDB. Part of the Oihana PHP ecosystem, this package bundles a modern HTTP client, a high-level façade, document/edge models, controllers, helpers and CLI commands — everything you need to build an ArangoDB-backed application end-to-end.
📚 Documentation
Full API reference (generated with phpDocumentor): https://bcommebois.github.io/oihana-php-arango
User guides (FR + EN) live under wiki/.
📦 Installation
Requires PHP 8.4+ and an ArangoDB 3.11+ server. Install via Composer:
composer require oihana/php-arango
✨ What you can do
- Talk to ArangoDB through a modern, ready-to-use HTTP client built on Guzzle — Basic + JWT/Bearer authentication, automatic 401 refresh, cluster failover, retry on transient errors.
- Run AQL queries with safe placeholder binding (
aql()helper), anAqlBuilderfor fluent assembly, and a lazyCursorsupportingmap / forEach / reduce / flatMap. - Manage collections, documents, edges and indexes — full CRUD, batch operations, bulk JSON-Lines import, 7 typed index types (
PersistentIndex,GeoIndex,TtlIndex,FulltextIndex,MdiIndex,VectorIndex,InvertedIndex). - Use transactions, graphs, analyzers and views — streaming transactions with
withTransaction()auto-commit/abort, gharial-based graphs with typed vertex/edge collections, ArangoSearch analyzers and views (full-textSEARCH,PHRASE,BM25). - Compose document models via fine-grained traits (CRUD, AQL helpers, signals before/after CRUD).
- Plug controllers into any Slim-compatible PSR-15 stack with
DocumentsController+ capability gating. - Run live smoke tests against a real
arangodvia the built-inarango:test:clientsandarango:test:facadeconsole commands.
Under the hood
- A consistent set of value objects and enums — no magic strings.
- Pure-PHP transport based on GuzzleHttp v7.
- Helpers for PSR-11 Container wiring.
- Hydration delegated to
oihana/php-reflect— the client returns array data by default, the high-level façade hydrates into typed objects. - Casbin RBAC adapter for ArangoDB included (
oihana\arango\casbin\ArangoCasbinAdapter).
✅ Running tests
Run all tests:
composer test
Run a specific test file:
composer test ./tests/oihana/arango/SomeTest.php
Live smoke tests against a real arango database
The package ships with two end-to-end smoke tests that exercise every public surface against a live ArangoDB server. They operate on an ephemeral database that is created and dropped per run, so production data is never touched.
# Copy the example config and adjust the [arango] section cp configs/config.example.toml configs/config.toml # Run the full smoke suite for the new clients/ HTTP library ./bin/console.php arango:test:clients # Run the smoke suite for the high-level ArangoDB façade ./bin/console.php arango:test:facade
Both commands accept --step=N, --step=N1-N2, --step=all, --no-cleanup, --endpoint=…, --user=…, --password=…, --database=….
🛠️ Generate the documentation
We use phpDocumentor to generate documentation into the ./docs folder.
composer doc
🧾 License
Licensed under the Mozilla Public License 2.0 (MPL‑2.0).
👤 About the author
- Author: Marc ALCARAZ (aka eKameleon)
- Email:
marc@ooop.fr - Website:
https://www.ooop.fr
🔗 Related packages
| Package | Description |
|---|---|
| oihana/php-auth | Casbin RBAC + JWT/OIDC authorization toolkit. |
| oihana/php-commands | Symfony Console kernel and reusable command traits. |
| oihana/php-core | Core helpers and utilities shared across the ecosystem. |
| oihana/php-enums | Typed constants and enums — no more magic strings. |
| oihana/php-exceptions | Framework exceptions with consistent semantics. |
| oihana/php-files | File system helpers (paths, readers, writers). |
| oihana/php-reflect | Reflection and object hydration utilities. |
| oihana/php-schema | Schema.org constants and vocabulary. |
| oihana/php-signals | Signal/slot dispatcher for decoupled events. |
| oihana/php-system | Framework helpers — controllers, models, request handling. |
