Simple helper for working with Guzzle and wordpress rest API
Via Composer
$ composer require maciekpaprocki/wordpress-guzzle-wrapper
Repositories are de facto your query builders.
Provided with query information they need to return async promise (or whatever wrapped in promise).
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 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);
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.
Please see CHANGELOG for more information what has changed recently.
$ composer test
The MIT License (MIT). Please see License File for more information.