Download the PHP package lmerotta/phpokeapi without Composer
On this page you can find all versions of the php package lmerotta/phpokeapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lmerotta/phpokeapi
More information about lmerotta/phpokeapi
Files in lmerotta/phpokeapi
Package phpokeapi
Short Description A PHP7.1 Wrapper for PokéAPI, with cache and lazy-loading
License MIT
Informations about the package phpokeapi
PHPokéAPI
A PHP7.1+ wrapper for PokéAPI. This package offers the possibility to query the majority of the PokéAPI endpoints (see exceptions below). It supports caching of responses and lazy-loading relations.
Installation
composer require lmerotta/phpokeapi
Basic Usage
UsePokeAPI\Client
to query the endpoints directly through the named methods.
` You can then traverse the returned object. All its relations will be proxies, and won't make any new requests to the API except if you explicitly call one of their getters
All the requests made are cached, so you won't have to query twice for the same dataset.
PokeAPI\Client
The PokeAPI\Client
takes 3 optional parameters:
$url
, a string pointing to the base URL of the PokéAPI. Defaults to pokeapi.co$cache
, APsr\SimpleCache\CacheInterface
. Defaults to aSymfony\Component\Cache\Simple\FilesystemCache
instance$serializer
, AJMS\Serializer\SerializerInterface
implementation.
Contributing
Feel free to open pull requests or submit issues!
All versions of phpokeapi with dependencies
ocramius/proxy-manager Version ^2.1
psr/cache Version ^1.0
psr/simple-cache Version ^1.0
symfony/cache Version ^4.0
doctrine/common Version ^2.8
jms/serializer Version ^1.11
symfony/yaml Version ^4.0