oihana / php-openedge
Composable PHP toolkit for the Progress OpenEdge SQL database via ODBC. Bundles a functional query builder (predicates, casts, string/numeric/date functions, CASE expressions), document/edge models composed by traits, PSR-7 CRUD controllers, and Symfony Console commands. Built for read-heavy ERP int
Requires
- php: >=8.4
- ext-pdo: *
- oihana/php-core: dev-main
- oihana/php-enums: dev-main
- oihana/php-exceptions: dev-main
- oihana/php-reflect: dev-main
- oihana/php-schema: dev-main
- oihana/php-system: dev-main
- php-di/php-di: ^7.0
- psr/container: ^2.0
- psr/http-message: ^2.0
- psr/simple-cache: ^3.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:09:27 UTC
README
Composable PHP toolkit for the Progress OpenEdge SQL database, accessed via ODBC. Part of the Oihana PHP ecosystem, this package bundles a functional query builder (predicates, casts, string/numeric/date functions, CASE expressions), document/edge models composed by traits, PSR-7 CRUD controllers, and Symfony Console commands โ everything you need to build a read-heavy ERP integration end-to-end.
๐ Documentation
Full API reference (generated with phpDocumentor): https://bcommebois.github.io/oihana-php-openedge
User guides (FR + EN) live under wiki/.
๐ฆ Installation
Requires PHP 8.4+ with the ext-pdo extension, and the Progress DataDirect OpenEdge ODBC driver installed on the host running the application. Install via Composer:
composer require oihana/php-openedge
โจ What you can do
- Build OpenEdge SQL queries with a fully functional API โ column expressions, value/literal expressions, ORDER BY / LIMIT / GROUP BY, search conditions, predicates (basic, between, exists, in, like, null, quantified) โ without ever concatenating strings.
- Cover every OpenEdge SQL function โ string (
concat,substring,lpad,proArrayEscape, ...), numeric (abs,round,power,mod, ...), date (now,sysTimestamp, ...), conditional (coalesce,ifNull,nvl, ...), conversion (toChar,toDate,toNumber, ...), and the full ODBC cast catalogue (castBIGINT,castVARCHAR,castTIMESTAMP, ...). - Compose CASE expressions declaratively โ
whenThenExpression(...),elseExpression(...), no string templates. - Apply value mutators through the
alters/pipeline โalterDate,alterKey,alterNumeric,alterString,alterConditional,alterConversion. - Persist and load documents through trait-composed models โ
Documents,DocumentsList,DocumentsGet,DocumentsCount,DocumentsStreametc. โ withbindExpressionplaceholders andSORTABLEwhitelisting baked in. - Plug controllers into any Slim-compatible PSR-15 stack via
DocumentsController(list, get, count) โ read-only by default to match the typical ERP integration profile.
Under the hood
- A consistent set of typed enums and constants โ
OpenEdgeFunctionType,OpenEdgeOperator, etc. โ no magic strings anywhere. - Pure functional helpers, registered through Composer
autoload.filesso they are always available withoutuseboilerplate. - PDO-based โ uses the standard
ext-pdo+ ODBC driver path, so it works the same way on Linux (DataDirect driver) and Windows (Progress ODBC driver) hosts. - Schema.org-friendly โ models extend
org\schema\Thingfromoihana/php-schema, so JSON-LD output is natural.
โ Running tests
Run all tests:
composer test
Run a specific test file:
composer test ./tests/oihana/openedge/db/helpers/functions/casts/CastVarCharTest.php
The unit tests cover the pure functional helpers โ they do not require an ODBC driver or a live OpenEdge server. End-to-end smoke tests against a real OpenEdge instance live in the consuming application.
๐ ๏ธ 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-arango | Composable toolkit for ArangoDB โ document/edge models, AQL helpers, controllers. |
| 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-http | HTTP helpers โ client IP, cookies, route patterns. |
| oihana/php-reflect | Reflection and object hydration utilities. |
| oihana/php-schema | Schema.org constants and vocabulary. |
| oihana/php-system | Framework helpers โ controllers, models, request handling. |
