Download the PHP package as3/post-process-bundle without Composer
On this page you can find all versions of the php package as3/post-process-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download as3/post-process-bundle
More information about as3/post-process-bundle
Files in as3/post-process-bundle
Package post-process-bundle
Short Description Provides centralized support for executing callable code before Symfony framework termination.
License MIT
Informations about the package post-process-bundle
PostProcessBundle
Provides centralized support for executing callable code before Symfony framework termination
Installation
Install packages with Composer
To install this bundle via composer, perform the following command: composer require as3/post-process-bundle ^1.0
.
Register the Bundle
Once installed, register the bundle in your AppKernel.php
:
Usage
To use the PostProcessBundle, you must first create a class adhering to the Task\TaskInterface
or Plugins\PluginInterface
. A task is a process that will be executed on the Symfony terminate event (after the response is sent,) whereas a Plugin is a process that is run before the response is sent (allowing you to modify it.)
Tasks
A task can be used to execute logic after the response has been sent to the user, allowing you to trigger long-running processes that need to complete, but the user does not need to wait for them.
Example:
To register your task, call the addTask
method against the task manager's service (as3_post_process.task.manager
):
Tasks can have a priority
set when they are added to the manager -- by default new tasks are added with a priority of 0
. Tasks are executed in ascending order by their priority.
You can also register a service by using the tag as3_post_process.task
if your task should be run on every request.
Plugins
A plugin can be used to modify the response before it is returned to the user.
Example:
This plugin will disable automatic injection of NewRelic end user monitoring javascript. To enable this for all requests, add the following service definition: