ner0tic / php-api-core
core elements of a REST styled api walker
Installs: 142
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/ner0tic/php-api-core
Requires
- php: >=5.4
- guzzle/guzzle: ~3.1
README
ORM agnostic php library to access REST apis
Usage
use Ner0tic\ApiEngine\Api\AbstractApi; $api = new AbstractApi(); $client = $api->getClient();
If you have api keys to use, mash them into a pem file and
set the certificate
option to the path of the file.
$client->setOption('certificate', $pem_file);
Make a query
$result = $api->get($endpoint, $parameters, $request_options);
Working example:
use Ner0tic\ApiEngine\Api\AbstractApi(); $api = new AbstractApi(); $client = $api->getClient(); $users = $client->get('users', array('last_name' => 'smith')); foreach($users as $user) $user = new \Acme\UserBundle\Entity\User($user); // ... use $users as needed