PHPackages                             as3/post-process-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. as3/post-process-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

as3/post-process-bundle
=======================

Provides centralized support for executing callable code before Symfony framework termination.

1.0.8(9y ago)113.0k1MITPHPPHP &gt;=5.4

Since Nov 1Pushed 9y ago3 watchersCompare

[ Source](https://github.com/as3io/PostProcessBundle)[ Packagist](https://packagist.org/packages/as3/post-process-bundle)[ RSS](/packages/as3-post-process-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

PostProcessBundle
=================

[](#postprocessbundle)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4068b794c96bd0a8ce16ce98b1f5f4b5e284e32f57b6043998d83a25b1a32249/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617333696f2f506f737450726f6365737342756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/as3io/PostProcessBundle/?branch=master) [![Build Status](https://camo.githubusercontent.com/a336c7d408f33f0df4c7273d909248a1040bc4808165a2c61bc540c9d7ddccef/68747470733a2f2f7472617669732d63692e6f72672f617333696f2f506f737450726f6365737342756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/as3io/PostProcessBundle) [![Packagist](https://camo.githubusercontent.com/42d3d6caecca0463a5faf5a90b9b68c30cb380ff5b57960818fb08809d889d96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6173332f706f73742d70726f636573732d62756e646c652e737667)](https://packagist.org/packages/as3/post-process-bundle) [![SensioLabsInsight](https://camo.githubusercontent.com/a11b7e5638bf553101223463d337c902ea5500368dd8c48d21f8e8950fecfb85/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65643530643764392d633564352d346334642d626536662d6538383832303939373835652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/ed50d7d9-c5d5-4c4d-be6f-e8882099785e)

Provides centralized support for executing callable code before Symfony framework termination

Installation
------------

[](#installation)

### Install packages with Composer

[](#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

[](#register-the-bundle)

Once installed, register the bundle in your `AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new As3\Bundle\PostProcessBundle\As3PostProcessBundle(),
    );

    // ...
}
```

Usage
-----

[](#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

[](#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:

```
use As3\Bundle\PostProcessBundle\TaskInterface;

class SleepTestTask implements TaskInterface
{
    /**
     * {@inhericDoc}
     */
    public function run()
    {
        // Some process that takes 5 minutes
        sleep(300);
    }
}
```

To register your task, call the `addTask` method against the task manager's service (`as3_post_process.task.manager`):

```
    $manager = $this->get('as3_post_process.task.manager');
    $manager->addTask(new SleepTestTask(), 5);
```

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.

```
# src\MyBundle\Resources\services.yml
services:
my_app.my_cool_task:
    class: MyCoolTask
    tags:
        - { name: as3_post_process.task, priority: 5 }
```

### Plugins

[](#plugins)

A plugin can be used to modify the response before it is returned to the user.

Example:

```
use Symfony\Component\HttpFoundation\Response;

/**
 * Integration with New Relic End User Monitoring services
 */
class NewRelicInjector extends PluginInterface
{
    /**
     * Handles injection of NREUM Javascript
     */
    public function filterResponse(Response $response)
    {
        if (extension_loaded('newrelic')) {
            newrelic_disable_autorum();

            $content = $response->getContent();

            if (false != strpos($content, '')) {
                $content = str_replace('', sprintf("\n%s\n", newrelic_get_browser_timing_header()), $content);
            }

            if (false != strpos($content, '')) {
                $content = str_replace('', sprintf("\n%s\n", newrelic_get_browser_timing_footer()), $content);
            }

            $response->headers->set('X-NREUM', 'Enabled');

            // If we modified the content, set it on the response.
            if ($content !== $response->getContent()) {
                $response->setContent($content);
            }

            return $response;
        }
    }
}
```

This plugin will disable automatic injection of NewRelic end user monitoring javascript. To enable this for all requests, add the following service definition:

```
    my_app.my_bundle.new_relic_injector:
        class: MyApp\MyBundle\NewRelicPlugin
        tags:
            - { name: as3_post_process.plugin }
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~33 days

Total

9

Last Release

3394d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6509ef0ef5c96a8623262b2cea39fae98de11e7a7d7daa99b5409c411b17019?d=identicon)[zarathustra323](/maintainers/zarathustra323)

![](https://www.gravatar.com/avatar/1edba31ec2714e8cfac7a4c1232c56cf40a26d154876c0d9b42d984944056758?d=identicon)[solocommand](/maintainers/solocommand)

---

Top Contributors

[![solocommand](https://avatars.githubusercontent.com/u/1778222?v=4)](https://github.com/solocommand "solocommand (10 commits)")[![zarathustra323](https://avatars.githubusercontent.com/u/3289485?v=4)](https://github.com/zarathustra323 "zarathustra323 (1 commits)")

### Embed Badge

![Health badge](/badges/as3-post-process-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/as3-post-process-bundle/health.svg)](https://phpackages.com/packages/as3-post-process-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[symfony/ai-bundle

Integration bundle for Symfony AI components

32642.2k21](/packages/symfony-ai-bundle)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26411.5k9](/packages/sylius-taxonomy-bundle)[sylius/inventory-bundle

Flexible inventory management for Symfony applications.

19189.5k6](/packages/sylius-inventory-bundle)[yceruto/formflow-bundle

Create and manage multistep forms

2414.8k](/packages/yceruto-formflow-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1716.4k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
