2017 © Pedro Peláez
 

library console-extra-bundle

This bundle adds support for commands defined as DI services

image

seiffert/console-extra-bundle

This bundle adds support for commands defined as DI services

  • Monday, July 8, 2013
  • by PSeiffert
  • Repository
  • 2 Watchers
  • 21 Stars
  • 1,375 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

SeiffertConsoleExtraBundle

This bundle adds support for commands defined as DI services., (*1)

Build Status, (*2)

Setup

Require the package via composer:, (*3)

composer.json:, (*4)

    "require": {
        ...
        "seiffert/console-extra-bundle": "1.0.0",
        ...
    }

Activate the bundle in your AppKernel:, (*5)

app/AppKernel.php:, (*6)

    public function registerBundles()
    {
        $bundles = array(
            ...
            new Seiffert\ConsoleExtraBundle\SeiffertConsoleExtraBundle(),
            ...
        );
        ...
    }

Disable automatic command registration in each of your bundles defining commands by overriding Bundle::registerCommands() with an empty implementation:, (*7)

src\You\YourBundle\YouYourBundle.php:, (*8)

    public function registerCommands(Application $application)
    {
        // commands are registered by SeiffertConsoleExtraBundle
    }

Usage

After following the above setup steps, you can start defining all your commands as services. Command services are being identified by a special tag console.command:, (*9)

src\You\YourBundle\Resources\config\services.yml:, (*10)

parameters:
    acme_demo.test_command.class: Acme\DemoBundle\Command\TestCommand

services:
    acme_demo.test_command:
        class: %acme_demo.test_command.class%
        tags:
            - { "name": "console.command" }

Your commands will be added to the dependency injection container. This enables you to write commands that have their dependencies injected and therefore are truly unit-testable., (*11)

The Versions

08/07 2013

dev-master

9999999-dev

This bundle adds support for commands defined as DI services

  Sources   Download

CC-BY-SA-3.0

The Requires

 

08/12 2012

1.0.0

1.0.0.0

This bundle adds support for commands defined as DI services

  Sources   Download

CC-BY-SA-3.0

The Requires