Download the PHP package ddesrosiers/silex-annotation-provider without Composer

On this page you can find all versions of the php package ddesrosiers/silex-annotation-provider. 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 silex-annotation-provider

Latest Stable Version Build Status Total Downloads License Scrutinizer Code Quality

silex-annotation-provider

A Silex ServiceProvider that defines annotations that can be used in a Silex controller. Define your controllers in a class and use annotations to setup routes and define modifiers.

Changes in v3

Installation

Install the silex-annotation-provider using composer.

Registration

Parameters

annot.controllerDir

Specify the directory in which to search for controllers. This directory will be searched recursively for classes with the @Controller annotation. Found controller classes will be processed for route annotations. Either this or annot.controllers is required to locate controllers.

annot.controllers

An array of fully qualified controller names. If set, the provider will automatically register each controller as a ServiceController and set up routes and modifiers based on annotations found.

annot.cache

An instance of a class that implements Psr\SimpleCache\CacheInterface. This cache is used to cache annotation and the controller list to improve performance.

Faster Controller Registration

Silex has to register every endpoint in your app on every request. If you have a lot of endpoints, that could be a significant overhead on each and every request. Silex Annotations can improve this by filtering the controllers that need to be registered using the prefix on the Controller annotation. We only need to register the endpoints in the Controller if the prefix matches the URI. In this way, Silex Annotations allows FASTER routing than pure Silex.

Annotate Controllers

Create your controller. The following is an example demonstrating the use of annotations to register an endpoint.

The annotations in our TestController are interpreted as follows:

Annotations

Controller

The @Controller annotation marks a class as a controller. The 'prefix' option defines the mount point for the controller collection. The prefix must be the first option.

@Route

The @Route annotation defines an endpoint. 'uri' is required and must be the first option defined.

Short Annotation Notation

In the Controller annotation, if prefix is the only option needed, the 'prefix' key can be omitted.

In the Route annotation, if uri is the only option needed, the 'uri' key can be omitted.


All versions of silex-annotation-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
ext-pcre Version *
silex/silex Version ~2.0
psr/simple-cache Version ~1.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 ddesrosiers/silex-annotation-provider contains the following files

Loading the files please wait ....