News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Daniel Cousineau:
Using Symfony Console From Scratch
April 05, 2013 @ 12:46:43

Daniel Cousineau has posted a guide to using the Symfony Console component as a part of your application. It introduces you to some of the basics of using the component and has plenty of sample code to get you started.

CLI applications are extremely useful for many, if not most web projects. The Symfony framework even goes so far as to include an extensible CLI console used for everything from running cache cleanup/warmup tasks, to user account management. Many CLI scripts for web projects consist of just a static .php file which works fine but grow unweildy over time. Thankfully, the aforementioned Symfony Console component is released as a decoupled standalone that can be installed and setup easily and provide us with structure and organization (and some powerful features).

He walks you through the installation of the component via Composer and includes the code to make a simple CLI script using it. He shows how to make new commands (like his "TestCommand") and how to attach it to the application. He talks about output and input handling with arguments and options. He also shows an integration with an existing application with a base command class that helps to set up and configure the command objects that inherit it.

0 comments voice your opinion now!
symfony console tutorial introduction install usage

Link: http://dcousineau.com/blog/2013/03/28/using-symfony-console-from-scratch/

blog comments powered by Disqus

Similar Posts

Vid Luther's Blog: Changing MySQL storage engine for one table in your Propel/Symfony project

Wenbert Del Rosario's Blog: Zend Framework: Making the Built-in Breadcrumb Helper Work

Ibuildings Blog: Symfony 1.1

AnyExample.com: Downloading files from Amazon S3

Brian Swan's Blog: Creating PHP Websites with WebMatrix


Community Events





Don't see your event here?
Let us know!


release deployment api community framework zendserver podcast code bugfix voicesoftheelephpant threedevsandamaybe symfony series conference laravel list language introduction tips interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework