Download the PHP package braune-digital/api-base-bundle without Composer

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

BrauneDigitalApiBaseBundle

This Symfony-Bundle uses FOS Rest and provides Basic Api functionality

Features

Requirements

Installation

Download using composer:

And enable the Bundle in your AppKernel.

You may use the BaseApiController without registering the bundle too.

Configuration

DefaultConfiguration

FOSRest Configuration

NelmioCors Configuration

To support OPTIONS calls from your clients.

Security.yml Configuration

Usage

BaseApiController

The BaseApiController provides the underlying logic to create api-endpoints fast and easy: Just extend the BrauneDigital\ApiBaseBundle\Controller\BaseApiController and add your functions:

You will have to specifiy a Repository and you may need to override the function, if you want to create or update entities.

Security System

To restrict the access to single resources you will need to use symfony voters. Take a look at the BrauneDigital\ApiBaseBundle\Security\Authorization\Voter\BaseCrudVoter which specifies the attributes that are used for the corresponding routes.

Filter the ListAction

To filter list actions, one can override the method. The querybuilder can be customized before returning.

Serialization Groups (JMSSerializerBundle required)

Serialization Groups are used by the JMS Serializer to get a better control over the serialization process.

In your controller

You can easily Add Serialization Groups using or set them by calling .

Using the API-Request Header

Clients can also set serialization Groups by setting the header in the request. The Header may be a simple string, comma delimited or an array of strings.

Api-Key Authentication

In order to use api-tokens, you have to add a token to your User-Class:

And add your DB-Mapping (e.g. DoctrineORM):

Module Access

This Bundle provides a Module-Access Annotation, which can be used to restrict the access of specific routes to certain Roles. In contrast to the Symfony Voting system, this is based on api-endpoints and not on ressources. Import the annotation:

Add your modules:

Or if you only use a single module:

If the user has access to one of the modules, access will be granted. Define the Modules in your configuration:

Example:

Variable Configuration

You can set the _braune_digital_api_base_config attribute in your request to append your custom configuration (braune_digital_api_base.configuration) to your response:

The configuration will be available under the key configuration in your response.

Suggestions

Api-Documentation

We suggest the usage of NelmioApiDocBundle for a clean and easy to use api documentation.

JMSSerializerBundle

TODO


All versions of api-base-bundle with dependencies

PHP Build Version
Package Version
Requires white-october/pagerfanta-bundle Version ^1.0.0
nelmio/cors-bundle Version ^1.4.0
friendsofsymfony/rest-bundle Version ^2.0
symfony/security Version ~3.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 braune-digital/api-base-bundle contains the following files

Loading the files please wait ....