News Feed
Jobs Feed

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

Sasa Stamenkovic's Blog:
Building CLI Apps With Symfony Console Component
December 31, 2010 @ 00:33:58

Sasa Stamenkovic has submitted a new tutorial he's written up about how to build CLI applications in Symfony with the help of its console component.

When working with PHP, I usually use Zend Framework for my projects. It has nice code generation tool (Zend_Tool), MVC, forms, helpers and it's very flexible. But one aspect where Zend wasn't the best tool for the job is building CLI applications. [...] Symfony Console Component is still under development, and there is no good documentation yet. I managed to google out Fabien Potencier's slides from ConFoo 2010 conference where he mentioned the component and showed one simple example. But still, most of the time working with the component, I find myself reading its source code.

He creates a simple console calculator application that takes in two numbers and calculates the sum of the two numbers. He includes an addition to the "--help" menu. Complete code is included to build the CLI interface and to create the class it uses to make the calculation. He shows how to add new commands and a bit on how to test your new command. Complete source code is available on github.

0 comments voice your opinion now!
symfony console component commandline tutorial

blog comments powered by Disqus

Similar Posts

Pierre-Alain Joye's Blog: Debugging symfony (or any php script) with vim and Xdebug

Thilanka Kaushalya's Blog: How to use Mysql Transactions with PHP AJAX and PHP Part 2 - XML Communication/Processing

Coders' View Blog: The Strategy Pattern Using PHP

Kenny Katzgrau's Blog: Enable Site-Wide Profiling With CodeIgniter

Community Events

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

introduction application facebook package composer opinion component language hack example overview install framework code hhvm release podcast security unittest symfony2

All content copyright, 2014 :: - Powered by the Solar PHP Framework