akrabat / slim3-skeleton

Simple Slim Framework 3 skeleton with Twig & Monolog
BSD 3-Clause "New" or "Revised" License
344 stars 99 forks source link

Can you show us an example cli script? #30

Closed needcaffeine closed 8 years ago

needcaffeine commented 8 years ago

That would be an excellent addition to the skeleton.

I can't seem to accomplish this by mocking the environment.

akrabat commented 8 years ago

PSR-7 isn't really designed for CLI as Request and Response are modelled on HTTP messages.

I would suggest adding Symfony console or zfcampus/zf-console to your application. Your model layer should be separate from your route callables, so all your business logic is available and you can of course, use the DI container with a console component.

needcaffeine commented 8 years ago

Oh I never followed up with you on this. I ended up implementing Symfony console into my project. Thank you for the advice. If you think it belongs, I can add it to the skeleton.