Download the PHP package edmundluong/php-api-client without Composer

On this page you can find all versions of the php package edmundluong/php-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-api-client

PHP API Client

Build Status License

Provides a simple layer of abstraction over the Guzzle Services client in order to facilitate common tasks related to making API requests to web services, such as logging and HTTP request signing for authentication purposes.

Installation

PHP API Client requires PHP 5.5 or higher. Install the package via Composer:

Basic Usage

Define the API endpoints you want to access by extending the AbstractApiDescription base class and overriding the load() method to return a new static with the API endpoints defined.

[See documentation on Guzzle Service Descriptions for more information.] (http://guzzle3.readthedocs.org/webservice-client/guzzle-service-descriptions.html)

An example of a Twitter URLs API description:

To consume your API description with an API client, simply extend the AbstractApiClient base class and override the $apiDescription field with your API description's class name:

Finally, instantiate your API client and make API calls using the method names you defined in the API description, under the operations section:

Response:

Authenticators

Should you need authentication for your API requests, you can authenticate your client with an Authenticator object. Authenticator objects intercept outgoing HTTP requests and sign them before they are sent out.

This is very useful for various authentication flows, such as OAuth2 or HMAC, where requests must have additional parameters appended to them (e.g., access tokens).

Simply extend the AbstractAuthenticator base class and define the authentication logic required within the sign() method:

In this example, TwitterUrlsOauthAuthenticator appends access_token=token_value to all GET requests.

In order to authenticate the client using the Authenticator, simply override the $authenticators array field from AbstractApiClient with an associative array of Authenticator class names:

The key value that the Authenticator class name is mapped to (in this case, 'oauth2') is used to locate the desired Authenticator object for the client during initialization. Simply pass authType in your configuration array with the desired key to apply the Authenticator object to your client:

Debugging

The AbstractApiClient base class has a built-in LogSubscriber that can be toggled on/off by passing in a debug flag in the configuration array for the client (note that the value must be true):

Using the OAuth2 client from the previous example:

Output:

Additionally, a PSR-3 compatible Logger can be passed into the configuration array as well for usage by passing in a debugLogger option:

Documentation

See the official Guzzle Web Service client documentation for more information.

Contributing

Please submit any pull requests to the develop branch. Pull requests are welcome and will be happily accepted given that the contributed code follows the PSR-2 Coding Style Guide.

License

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.


All versions of php-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
guzzlehttp/guzzle-services Version 0.5
guzzlehttp/log-subscriber Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package edmundluong/php-api-client contains the following files

Loading the files please wait ....