Download the PHP package franjid/api-wrapper-bundle without Composer

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

API Wrapper Bundle for Symfony

Build Status Scrutinizer Code Quality Code Coverage

The aim of this bundle is to act as a wrapper for any API library you want to use in Symfony. In this case with Guzzle, the most popular PHP HTTP client library.

It has never been so easy to consume an API than with this bundle.

What can you find?

Api.php

This is where the encapsulation magic happens.

It has only one method send that sends the proper request to the API.

ApiClientFactory.php

Used to create all different API clients. When defined it requires a base uri for the API as a simple string or an array of different url's. In case that an array is given, the factory will choose one of them randomly. This is kind of a basic basic load balancer implemented because of reasons.

ApiRequest.php

It has to be used to send requests to API's. Using the different methods you will be able to set the request method (GET, POST, etc), set headers, set the endpoint, etc.

ApiResponse.php

Object returned when successfully calling send method in Api. You can get the response status code, headers or body.

How to use it

First things first, install package via composer:

And add the bundle to your AppKernel.php

Example: adding an API for Xkcd API

You can check a project with example code using the bundle in this repository

First step is to define the API Client in your services config file

That will create the ApiClientXkcd taking the parameter apiXkcdBaseURI and injecting it so we have a base URI.

apiXkcdBaseURI should be in the format

Now is time to create the interface, then the service class and add it to your services config file

At this moment you're ready to go for adding your awesome methods that will call the API.


All versions of api-wrapper-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5.9|~7.0
symfony/framework-bundle Version ^2.7|^3.0
symfony/config Version ~2.3|~3.0
guzzlehttp/guzzle Version ~6.2.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 franjid/api-wrapper-bundle contains the following files

Loading the files please wait ....