Download the PHP package codag/restfabrication-bundle without Composer

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

RestFabricationBundle

This bundle provides an approach for rapid development of RESTful APIs for your Symfony2 Project.

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version Latest Unstable Version License Dependency Status

Installation

  1. Add CodagRestFabricationBundle to your composer.json
  2. Enable the bundle

Step 1: Add CodagRestFabricationBundle to your composer.json

Update your project dependencies:

Step 2: Enable the bundle

Usage

For further implementation examples please see also the following blog post: (coming soon).

Domain Manager

The domainn manager is a more abstract way to communicate with the data layer (e.g. Doctrine). As it takes an entity as an argument, the benefit will be high reusability. Each resource should be represented by it's own domain manager that can be easily defined within the service container (services.xml).

We therefore create new services for all our resources (entities) so that each time a new class of "codag_rest_fabrication.domain_manager.default.class" will be instatiated with the provided entity as an argument:

The created domain manager can now be used in a controller to prevent implementing duplicate code for action methods they represent simple restful (GET/DELETE) requests:

As we can see, the domain manager provides methods to find one or multiple entires and can directly remove entries. Please refer to the code for the full implementation set.

Form Handler

The form handler relies on the domain manager and provides processing of forms created during the process of an incoming PUT/POST request.

We therefore create new services for all our resources (entities) they relie on forms so that each time a new class of "codag_rest_fabrication.form_handler.create_form.class" will be instatiated. As a single argument the resource related domain manager has to be provided:

The created form manager can now be used in a controller to prevent implementing duplicate code for action methods they represent simple restful (PUT/POST) requests and have to be processed with forms:

Exceptions

InvalidFormException

To be able to deal with a clean error management, this exception can be used whenever a form is processed. The exception can be thrown during the process of the form handler. For validation purposes then exception will then be catched within the controller to finally return the form to the view.

Form Handler:

Controller:

ResourceNotFoundException

To not constantly repeat yourself, this exception is a wrapper of the NotFoundHttpException that holds a standard sentence. In addition it takes the resource name as well as the value of the identifier.

Controller:

Output:

RestException

For the sake of completeness this exception is a wrapper of the HttpException and may be extended in the near future.

Contribute

If the bundle doesn't allow you to customize an option, I invite you to fork the project, create a feature branch, and send a pull request.

To ensure a consistent code base, you should make sure the code follows the Coding Standards.

License

This bundle is under the MIT license. See the complete license here.


All versions of restfabrication-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
friendsofsymfony/rest-bundle Version 1.4.*
symfony/form Version ~2.2
doctrine/orm Version ~2.2,>=2.2.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 codag/restfabrication-bundle contains the following files

Loading the files please wait ....