Download the PHP package dlinsmeyer/api-response-bundle without Composer

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

Symfony2 API Response Bundle

  1. Installation

To install the API bundle with Composer just add the following to your composer.json file:

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

  1. Configuration

    Via Symfony

    No additional configuration is needed. The app should properly detect all configurations in this bundle.

Via Silex

Since bundles are merely packages in Silex, we need to do some manual service configuration. Specifically, in this case, for our serializer.

  1. Pull in
  2. Add the following to your Silex bootstrap file:
  1. Usage

    With the introduction of the SerializationAdapterInterface, there are several more ways callers can utilize the response builder.

JMS Serializer

If no other configuration is made, JMS serializer will be used by default.

JSON Serializer

In order to use json_encode serialization, you need to make a config change

Note: By default, this serializer disregards all context-related data such as version, group, etc. Only the response model will be encoded.

Other than that, follow the code sample in the above for usage.

  1. Extension

    Overriding MixedTypeHandler

    A need may arise for you to extend the class. In such instance, perform the following.

Create Overriding Class

Create a class which extends the MixedTypeHandler. Such as below:

Override service

In your calling library's services configuration file, perform the following:

Creating a custom serializer

By default, this library comes with JMS and json_encode() serialization by default. To add support for other serializers, perform the following:

  1. Create a class that extends the SerializerAdapterInterface
  2. Create a service definition for that class.
  3. In your config, define the following:

All versions of api-response-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/framework-bundle Version ~2.1
jms/serializer-bundle Version 0.13.*@dev
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 dlinsmeyer/api-response-bundle contains the following files

Loading the files please wait ....