Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC][Framework-Bundle] Make an Application available as a container service #29325

Copy link
Copy link
Closed
@edefimov

Description

@edefimov
Issue body actions

Some use-cases require to inject an instance of Symfony\Component\Console\Application class into arbitrary service.

Example use-case: there is a daemon based on symfony console component which can run workers. Each worker is a container service. Some workers can run arbitrary application commands inside the separated process (as an example of such a command is consuming messages). To run a command worker needs an instance of Application.

<service id="App\Worker\SomeWorker">
    <argument type="service" id="Symfony\Component\Console\Application" />
</service>

<!-- or -->
<service id="App\Worker\SomeWorker">
    <argument type="service" id="application" />
</service>

This feature will also reduce complexity of adding custom helper sets by defining them as services and injecting them into Application service using CompilerPass.

<service id="App\Console\HelperSet\MyHelper">
    <tag name="console.helper_set" helper="my" />
</service>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.