Download the PHP package oihana/php-magento without Composer
On this page you can find all versions of the php package oihana/php-magento. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oihana/php-magento
More information about oihana/php-magento
Files in oihana/php-magento
Package php-magento
Short Description Composable PHP client for the Magento 2 REST API. Bundles an OAuth1-signed HTTP client (Guzzle), typed Magento entity schemas (Product, ProductImage, MediaGalleryEntry, ...), composable client traits, and a fluent SearchCriteria builder.
License MPL-2.0
Homepage https://github.com/BcommeBois/oihana-php-magento
Informations about the package php-magento
Oihana PHP Magento

Composable PHP client for the Magento 2 REST API. Part of the Oihana PHP ecosystem, this package bundles an OAuth1-signed HTTP client (Guzzle), typed Magento entity schemas, composable client traits, and a fluent SearchCriteria builder โ the building blocks to query the Magento 2 REST API from PHP.
๐ Documentation
Full API reference (generated with phpDocumentor): https://bcommebois.github.io/oihana-php-magento
User guides (FR + EN) live under wiki/.
๐ฆ Installation
Requires PHP 8.4+ and a Magento 2 instance with REST API access. Install via Composer:
โจ What you can do
- Talk to Magento 2 over REST through a ready-to-use HTTP client built on Guzzle โ OAuth1 signed requests (consumer key + secret + access token + secret) with automatic nonce + timestamp generation, HMAC-SHA1 / HMAC-SHA256 signatures, and proper RFC 5849 query/body parameter handling.
- Build search criteria fluently โ the
SearchCriteriahelper turns(field, value, condition, group, sortOrder, pageSize, currentPage)tuples into the verbosesearchCriteria[filter_groups][...]query parameters Magento expects. - Hydrate typed entities โ
Product,ProductImage,MediaGalleryEntry,ProductVideo,ProductMediaGalleryEntriesContentand friends, with field-awareHydrateWithattributes for nested objects. - Access product media gallery โ composable
MagentoProductsTraitexposes products and media-gallery operations on top of the client; theMediaTypeandProductImageThumbnailenums make image-role logic explicit.
Under the hood
- A consistent set of value objects and enums โ
Magento,MagentoOption,MagentoParam,SearchCriteriaParam,ConditionTypeโ no magic strings. - Pure-PHP transport based on GuzzleHttp v7. OAuth1 signing is implemented from scratch in
OAuthSignerโ no third-party OAuth library required. - Hydration delegated to
oihana/php-reflectโ Magento response payloads map directly to typed objects via theHydrateWithattribute. - Schema constants split into trait-composed
ProductTrait,ThingTrait,MediaGalleryInterfaceTrait,MediaGalleryEntryTraitโ composable in your own DTOs.
โ Running tests
Run all tests:
Run a specific test file:
The unit tests cover the OAuth1 signer, the search criteria builder, and the field utility helpers โ they run without a live Magento instance.
๐ ๏ธ Generate the documentation
We use phpDocumentor to generate documentation into the ./docs folder.
๐งพ License
Licensed under the Mozilla Public License 2.0 (MPLโ2.0).
๐ค About the author
- Author: Marc ALCARAZ (aka eKameleon)
- Email:
[email protected] - Website:
https://www.ooop.fr
๐ Related packages
| Package | Description |
|---|---|
| oihana/php-auth | Casbin RBAC + JWT/OIDC authorization toolkit. |
| 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-http | HTTP helpers โ client IP, cookies, route patterns. |
| oihana/php-openedge | Progress OpenEdge SQL toolkit (ODBC, query builder, models). |
| oihana/php-reflect | Reflection and object hydration utilities. |
| oihana/php-system | Framework helpers โ controllers, models, request handling. |
All versions of php-magento with dependencies
guzzlehttp/guzzle Version ^7.10
php-di/php-di Version ^7.0
psr/container Version ^2.0
oihana/php-commands Version dev-main
oihana/php-core Version dev-main
oihana/php-enums Version dev-main
oihana/php-exceptions Version dev-main
oihana/php-files Version dev-main
oihana/php-logging Version dev-main
oihana/php-reflect Version dev-main