Download the PHP package emanuilnikolov/igdb-api-bundle without Composer

On this page you can find all versions of the php package emanuilnikolov/igdb-api-bundle. 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 igdb-api-bundle

Build Status Latest Stable Version Latest Unstable Version License

IgdbApiBundle

This bundle provides an easy way to communicate with the Internet Game Database API. You can contribute to the project via a pull request.

Installation

Prerequisites

The Symfony bundles and Guzzle are automatically included by composer.

Composer

To get the latest version of the bundle through Composer, run the command:

Configuration

Without Symfony Flex

Enable the bundle in app/AppKernel.php:

copy the following in your app/config/config.yml file:

and update your .env file:

With Symfony Flex

This bundle has a Flex recipe that will automatically add en_igdb_api.yaml in your config/packages directory and update your .env file accordingly.

Using your credentials

Assign YOUR_BASE_URL and YOUR_API_KEY in the .env file your own credentials, which can be found at the IGDB API's homepage (you have to be logged in).

If you do not wish to use environment variables (highly recommended), you can replace the '%env(YOUR_BASE_URL)%' and '%env(YOUR_API_KEY)%'.

Usage

Available Services

To achieve greater flexibility, it is advised to type hint the desired service's interface instead of the actual implementation.

Parameter Builder

The builder is used to form the query string that will be sent to the API. It utilizes method chaining to gather the parameters' values. Upon calling the buildQueryString() method (done automatically in the wrapper), they are combined into a query string. The available parameters are listed here. They are available as methods in the ParameterBuilder and can be chained as follows:

Example

Hints

Then, the IgdbWrapper can be used to fetch the desired collection:

Wrapper

Endpoints

The endpoints described in the API's documentation are available as methods in the IgdbWrapper. All of them accept an instance of the ParameterBuilder and return a PHP associative array with the data. The bundle utilizes the PSR-7 Standard

Example

Private Endpoints

These will be introduced in the next release of the bundle.

Scroll API

This is a functionality provided by the IGDB API that provides a simpler and faster way to paginate your results. You can read more about it here.

Example

Search

Searching is done by using the IgdbWrapper's search() method or through setting the ParameterBuilder's setSearch() method.

Other useful methods

All the methods below (except fetchDataAsJson()) are used internally by the endpoints' methods.

fetchData()

This method is behind each one of the endpoints' methods and can be used independently.

fetchDataAsJson()

Same as fetchData(), but the native JSON response of the API is returned as a string, instead of a PHP associative array.

sendRequest()

Send an HTTP Request to a given URL. This method assigns the $response property of the IgdbWrapper. Modifies behaviour of Guzzle's request() method by adhering to the good practice of still returning a response and not throwing an exception when a 4xx or a 5xx error occurs.

You can read more about the available methods for the $response here

processResponse()

Decode the provided response's body to a PHP associative array, using the json_decode() function. If the API returns an unsupported by json_decode() type of data, it is still included into an array.

getEndpoint()

Combine the base URL and the endpoint.


All versions of igdb-api-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
symfony/config Version ^3.4|^4.0
symfony/dependency-injection Version ^3.4|^4.0
symfony/http-kernel Version ^3.4|^4.0
guzzlehttp/guzzle Version ^6.3
ext-json Version *
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 emanuilnikolov/igdb-api-bundle contains the following files

Loading the files please wait ....