webgriffe / amp-magento
Magento REST Api wrapper to use with Amp PHP framework.
Installs: 2 301
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: ~7.3.0|~7.4.0|~8.0.0
- ext-json: *
- ext-xml: *
- amphp/amp: ^2.1
- amphp/artax: ^3.0
- amphp/byte-stream: ^1.6
- amphp/file: ^0.3
- amphp/uri: ^0.1
- cweagans/composer-patches: ^1.7
- justinrainbow/json-schema: ^5.2
- nikic/fast-route: ^1.3
- phpunit/phpunit: ^9.0
- webmozart/assert: ^1.4
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-20 17:30:38 UTC
README
Magento REST Api wrapper to use with Amp PHP framework.
Installation
Require this package using Composer:
composer require webgriffe/amp-magento
## Usage
ApiClient is the main class of this library: it contains methods that wrap Magento REST API.
<?php use Amp\Artax\DefaultClient; use Webgriffe\AmpMagento\ApiClient; require_once __DIR__.'/vendor/autoload.php'; $client = new ApiClient( new DefaultClient(), [ 'baseUrl' => 'http://magento.base.url', 'username' => 'magento-username', 'password' => 'magento-password' ] ); $order = \Amp\Promise\wait($client->getOrder(1)); var_dump($order);
In Memory Magento
The folder InMemoryMagento contains a fake Magento server and client to be used for automated testing. Unit tests in tests/ApiClientTest.php show how to use InMemoryMagento.
Contributing
To contribute simply fork this repository, do your changes and then propose a pull requests. You should run coding standards check and tests as well:
vendor/bin/phpcs --standard=PSR2 src vendor/bin/phpunit
License
This library is under the MIT license. See the complete license in the LICENSE file.
Credits
Developed by Webgriffe®