maciekpaprocki / wordpress-guzzle-wrapper
Wordpress guzzle wrapper
Requires
- php: ~5.6|~7.0
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- cache/cache: ^0.1.0
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2024-11-09 19:52:04 UTC
README
Simple helper for working with Guzzle and wordpress rest API
Install
Via Composer
$ composer require maciekpaprocki/wordpress-guzzle-wrapper
Usage
Repositories
Repositories are de facto your query builders.
Provided with query information they need to return async promise (or whatever wrapped in promise).
Transformers
Transformers are responsible for converting data received from async calls. All the data is transformed using json_decode then if data is object transformers are run on whole data set. If data is array transformers are run on each of the array values.
Pool
Pool is responsible for aggregating three services.
- Transformers
- Cache
use BureauVA\WordpressGuzzle\Pool; $pool = new Pool(); $pool->setTransformers(...Transformer Array); $pool->setCachePool(...External Cache Pool); $pool->setPromises(...Promises array);
Contributing
Yope, so you need to have those ones installed globaly:
then run those lines in empty folder of your choice
git clone git@github.com:bureau-va/wordpress-guzzle-wrapper.git . touch .git/hooks/pre-commit sudo chmod 777 .git/hooks/pre-commit echo "composer pre-commit" >> .git/hooks/pre-commit
this will set up base repo and make sure that before each commit your local tests and cs fixer are used.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Credits
License
The MIT License (MIT). Please see License File for more information.