PHPackages                             tourze/symfony-runtime-context-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. tourze/symfony-runtime-context-bundle

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

tourze/symfony-runtime-context-bundle
=====================================

Symfony 上下文管理和延迟执行模块

1.0.1(8mo ago)018.1k↑185%8MITPHPCI passing

Since Apr 17Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/tourze/symfony-runtime-context-bundle)[ Packagist](https://packagist.org/packages/tourze/symfony-runtime-context-bundle)[ RSS](/packages/tourze-symfony-runtime-context-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (19)Versions (9)Used By (8)

Symfony Runtime Context Bundle
==============================

[](#symfony-runtime-context-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/a647159d88ea8300e24bbf40ee5acc1a320a01da5486bb55bb6ed73cc7c69282/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f73796d666f6e792d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-runtime-context-bundle)[![Total Downloads](https://camo.githubusercontent.com/4a9e553c9d4916c023cb86446931695ceaee8602465858e6fc14fd3de001948c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f73796d666f6e792d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-runtime-context-bundle)[![PHP Version Require](https://camo.githubusercontent.com/10defc4cefa90fb0bee1f26a0666f0505fcc61233b7d45ea76aba44d257813ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f73796d666f6e792d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-runtime-context-bundle)[![License](https://camo.githubusercontent.com/f2088e955b6752005be8dc247b75d33aaae4c91596cd113dc59bdabc92924529/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f73796d666f6e792d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-runtime-context-bundle)[![Coverage Status](https://camo.githubusercontent.com/0cf01021f33d3f521fd074f5a733ef3ecd714c1c18e659c051c51b3649c61f86/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f73796d666f6e792d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/symfony-runtime-context-bundle)

> Context management module for Symfony applications, supporting deferred task execution and unique context identification.

Features
--------

[](#features)

- Obtain a unique ID for the current runtime context
- Support for deferred (defer) task execution
- Reset mechanism compatible with Symfony lifecycle
- Extensible for different contexts (e.g., FPM, CLI)

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

[](#installation)

- Requires PHP 8.1+
- Requires Symfony 6.4+ core components
- Install via Composer:

```
composer require tourze/symfony-runtime-context-bundle
```

Quick Start
-----------

[](#quick-start)

1. Register the bundle in `config/bundles.php`:

    ```
    return [
        Tourze\Symfony\RuntimeContextBundle\RuntimeContextBundle::class => ['all' => true],
    ];
    ```
2. Inject and use `ContextServiceInterface`:

    ```
    use Tourze\Symfony\RuntimeContextBundle\Service\ContextServiceInterface;

    public function index(ContextServiceInterface $contextService)
    {
        $id = $contextService->getId();
        $contextService->defer(function () {
            // Deferred task
        });
    }
    ```

Documentation
-------------

[](#documentation)

- `ContextServiceInterface`: Defines the core context service interface, including unique ID retrieval, deferred execution, and coroutine support
- `DefaultContextService`: Default implementation based on process ID or generated unique ID
- `DeferCallSubscriber`: Event subscriber responsible for executing all deferred tasks at the end of the lifecycle

Contributing
------------

[](#contributing)

- Issues and PRs are welcome
- Follow PSR-12 code style
- Please ensure PHPUnit tests pass before submitting

License
-------

[](#license)

- MIT License
- (c) tourze

Changelog
---------

[](#changelog)

- See CHANGELOG.md or commit history for details

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance64

Regular maintenance activity

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~28 days

Recently: every ~48 days

Total

8

Last Release

244d ago

Major Versions

0.0.6 → 1.0.02025-10-31

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-symfony-runtime-context-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-symfony-runtime-context-bundle/health.svg)](https://phpackages.com/packages/tourze-symfony-runtime-context-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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