zfcampus / zf-console

Create console applications in PHP
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Allow pulling commands from container #28

Closed mtymek closed 8 years ago

mtymek commented 9 years ago

This PR updates Dispatcher class, so that it can optionally pull commands from container-interop-compatible container.

Usage:

$serviceManager = new ServiceManager(/* ... */);
$dispatcher = new Dispatcher($serviceManager);
$application = new Application('App', 1.0, $routes, null, $dispatcher);

After configuration, you can specify valid identifier as route handler, and Dispatcher will try to retrieve it when route is matched. This can help to lazily load complex command objects requiring configuration via factory.

Solves #15.

mtymek commented 9 years ago

Any chance to get it merged @weierophinney? Thanks!

vaclavvanik commented 9 years ago

+1

jaapio commented 8 years ago

+1

ArnaudLigny commented 8 years ago

:+1:

stefanotorresi commented 8 years ago

:+1:

snapshotpl commented 8 years ago

:+1:

weierophinney commented 8 years ago

Merged to develop for release with 1.3.0. Thanks, @mtymek !