Download the PHP package cobwebinfo/shrek-api-client without Composer

On this page you can find all versions of the php package cobwebinfo/shrek-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 shrek-api-client

S.H.R.E.K API Client

Build Status

Codacy Badge

This library can be used to pull data from the various public endpoints provided by the SHREK API. The client has been created with ease of use in mind, simply provide your API ID and private key and use the instructions below to proceed.

Compatibility

Client Version PHP Version
1.0.* 5.3 - 5.4
1.2.* 5.5+

Installation

The suggested installation method is via composer:

Requesting access to the API.

Please contact Cobwebinfo at @ [email protected] to access an API key.

Usage

The ShrekServiceProvider class provides a neat wrapper for instantiating the various clients needed to access the API. You can manually instantiate the clients if you do not wish to use it, however.

You can get an instance as follows:

I would suggest adding this as a singleton to your service container. If you use Laravel for example, you could do the following:

The array passed to the provider is used for configuration. To see the available options, refer to the Config.yaml file.

Once you have a provider instance, you can access the various clients as follows:

You can then access data from the API as follows:

Caching

Please note: By default the app uses the 'NullStore' cache class. This is an implementation of the null object pattern, and as you may have guessed does not cache anything. If you intend to use this method, you will need to implement your own caching to avoid hitting API limits. Alternatively, if your application supports APC or memcache, you can use one of the inbuilt classes to handle caching automatically. To do so, use the config below:

If you wish to roll your own cache implementation then create a new class which uses the 'Cobwebinfo\ShrekApiClient\Cache\Contracts\Store' interface and pass the fully qualified name into the Provider, as follows:

Http Clients

By default Guzzle is used as the HTTP client. If you prefer not to use guzzle, then an alternative implementation is provided. To use this, provide the following config:

As with caching, you can also roll your own HTTP client should you so choose. Simply create a new class implementing the 'Cobwebinfo\ShrekApiClient\Support\HttpRequester' interface and pass in the full qualified name, as follows:

Please note: The class should return a '\Psr\Http\Message\ResponseInterface' instance.

Config

The package provides a Yaml reader sħould you want to store your client id, client secret or other config in a yaml file. It works as follows:

The above would return an associative array, which you could then pass into the ShrekServiceProvider.

Todo


All versions of shrek-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3,<8.0-DEV
symfony/yaml Version ^2.4
mockery/mockery Version 0.9.*
psr/http-message Version ~1.0
jr-cobweb/http Version 1.0.3
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 cobwebinfo/shrek-api-client contains the following files

Loading the files please wait ....