dev-master
9999999-devSpore client for PHP5.3+
MIT
The Requires
- php >=5.3.3
- swiftframework/cache master-dev
- symfony/console 2.1.*
- symfony/http-foundation 2.1.*
- twig/twig >=1.8,<2.0-dev
The Development Requires
api rest http client spore
Spore client for PHP5.3+
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP., (*2)
SPORE is a way to describe public services HTTP APIs such as twitter or applications with an HTTP interface such as Apache CouchDB using a simple language-agnostic JSON document that can be used by various language-specific implementations to dynamically or statically generate high level client objects., (*3)
The goal of this git repository is to host:, (*4)
Use Composer.phar, (*5)
cd Spore/ curl -s https://getcomposer.org/installer | php php composer.phar install
The examples are a good place to start. The minimal you'll need to have is:, (*6)
``` php loadSpec(__DIR__ . '/spec/github.json'); $response = $client->call('GET', 'get_user', array( 'user' => 'euskadi31' )); print_r($response->getContent()); ?>, (*7)
Output stdClass Object ( [type] => User [company] => Audiofanzine [public_gists] => 6 [followers] => 12 [created_at] => 2010-02-03T10:25:00Z [blog] => [following] => 42 [email] => [public_repos] => 14 [location] => Toulouse, France [html_url] => https://github.com/euskadi31 [name] => Axel Etcheverry [hireable] => [url] => https://api.github.com/users/euskadi31 [gravatar_id] => 6171ad2ceddde3288b87c546e92f2909 [avatar_url] => https://secure.gravatar.com/avatar/6171ad2ceddde3288b87c546e92f2909?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png [id] => 195383 [bio] => PHP & Zend Framework developer [login] => euskadi31 ) ### Generated client cd Spore/ bin/spore generate:client demo/spec/github.json ``` php getUser(array( 'user' => 'euskadi31' )); print_r($response->getContent()); ?>
Output, (*8)
stdClass Object ( [type] => User [company] => Audiofanzine [public_gists] => 6 [followers] => 12 [created_at] => 2010-02-03T10:25:00Z [blog] => [following] => 42 [email] => [public_repos] => 14 [location] => Toulouse, France [html_url] => https://github.com/euskadi31 [name] => Axel Etcheverry [hireable] => [url] => https://api.github.com/users/euskadi31 [gravatar_id] => 6171ad2ceddde3288b87c546e92f2909 [avatar_url] => https://secure.gravatar.com/avatar/6171ad2ceddde3288b87c546e92f2909?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png [id] => 195383 [bio] => PHP & Zend Framework developer [login] => euskadi31 )
The tests can be executed by using this command from the base directory:, (*9)
./vendor/mageekguy/atoum/bin/atoum --glob Tests/Units/
Bugs, (*10)
Spore client for PHP5.3+
MIT
api rest http client spore