PHPackages                             lexpress/console-service-provider - 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. [CLI &amp; Console](/categories/cli)
4. /
5. lexpress/console-service-provider

AbandonedArchivedLibrary[CLI &amp; Console](/categories/cli)

lexpress/console-service-provider
=================================

Console Service Provider for Silex Applications

v1.0.0(12y ago)71.8kMITPHP

Since Sep 15Pushed 12y ago1 watchersCompare

[ Source](https://github.com/LExpress/ConsoleServiceProvider)[ Packagist](https://packagist.org/packages/lexpress/console-service-provider)[ RSS](/packages/lexpress-console-service-provider/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Console Service Provider for Silex
==================================

[](#console-service-provider-for-silex)

The ConsoleServiceProvider enable [Symfony Console](http://symfony.com/doc/current/components/console/introduction.html)in [Silex](http://silex.sensiolabs.org/) make easy to register command from any other service provider.

Parameters
----------

[](#parameters)

- **console.name (optional):** The name of your application.
- **console.version (optional):** The version of your application.

Services
--------

[](#services)

- **console:** The Console Application. Use `$app['console']->run()`.

Registering
-----------

[](#registering)

Installation:

- Use the official Git repository ();
- Install it via [Composer](http://getcomposer.org) (lexpress/console-service-provider on Packagist).

Register the service provider in your Silex application.

```
$app->register(new LExpress\Silex\ConsoleServiceProvider(), array(
    'console.name'    => 'Wahou',
    'console.version' => '1.0',
));
```

Register commands
-----------------

[](#register-commands)

Services named with `command.*` are automatically registered to the console.

```
$app['command.propel.model.build'] = $app->share(function ($app) {
    return new Propel\Generator\Command\ModelBuildCommand();
});
```

Running the console application
-------------------------------

[](#running-the-console-application)

The Console Application is available in your Silex Application with the service alias `console`. To run it, you can create an executable file in your project.

```
#!/usr/bin/env php
