Download the PHP package phpextra/event-manager-silex-provider without Composer

On this page you can find all versions of the php package phpextra/event-manager-silex-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 event-manager-silex-provider

Silex Provider for EventManager

No configuration is needed.

This provider will replace your EventDispatcher class. Default symfony events were not removed and have higher priority. It means that PHPExtra event is always running after the sf event.

Below is a reference, to see how events from PHPExtra are mapped onto vanilla sf events. All events are cancellable (propagationStop property in sf event). Unlike in symfony, cancellable events are still sent to all listeners. This behaviour may change in future release of event manager.

Symfony event mapping

kernel.request
PHPExtra\EventManager\Silex\Event\RequestEvent
Symfony\Component\HttpKernel\Event\GetResponseEvent

kernel.controller
PHPExtra\EventManager\Silex\Event\PreDispatchEvent
Symfony\Component\HttpKernel\Event\FilterControllerEvent

kernel.view
PHPExtra\EventManager\Silex\Event\PostDispatchEvent
Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent

kernel.response
PHPExtra\EventManager\Silex\Event\ResponseEvent
Symfony\Component\HttpKernel\Event\FilterResponseEvent

kernel.finish_request
PHPExtra\EventManager\Silex\Event\PostRequestEvent
Symfony\Component\HttpKernel\Event\FinishRequestEvent

kernel.terminate
PHPExtra\EventManager\Silex\Event\PostResponseEvent
Symfony\Component\HttpKernel\Event\PostResponseEvent

Installation and usage

If you are using logger, it will be automatically injected into the event manager. Every class can now be a listener.

$app = new Silex\Application(array('debug' => true));
$app->register(new \PHPExtra\EventManager\Silex\EventManagerProvider());

$em = $app['event_manager'];

$em->addListener(new \PHPExtra\EventManager\Listener\AnonymousListener(function(RequestEvent $event){
    echo "Im in RequestEvent (Sf GetResponseEvent)";
}));

$em->addListener(new \PHPExtra\EventManager\Listener\AnonymousListener(function(SilexKernelEvent $event){
    echo "Im in some Symfony KernelEvent !";
}));

$em->addListener($app['my_controller']);

$em->addListener($app['mailer']);

...

Exception handling

Exceptions that will occur during an event are suppressed in production mode. In development, the event manager will break the event loop and re-throw all exceptions.

$em->setThrowExceptions(false); // suppress exceptions and continue event loop

Contributing

All code contributions must go through a pull request. Fork the project, create a feature branch, and send me a pull request. To ensure a consistent code base, you should make sure the code follows the coding standards. If you would like to help take a look at the list of issues.

Requirements

See composer.json for a full list of dependencies.

Authors

Jacek Kobus - [email protected]

License information

See the file LICENSE.txt for copying permission.

All versions of event-manager-silex-provider with dependencies

PHP Build Version
Package Version
Requires phpextra/event-manager Version ~1.0
silex/silex Version ~1.2
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 phpextra/event-manager-silex-provider contains the following files

Loading the files please wait ...