News 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

DevShed: Drawing More Complex Shapes with the GD Library in PHP

Blond R's Blog: Set up IIS 7 w/ MySQL and PHP 5

Smashing Magazine: Replicating MySQL AES Encryption Methods With PHP A Free Amazon EC2 Cloud Server Based LAMP Getting Started with the Fuel PHP Framework

Community Events

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

release introduction php7 series voicesoftheelephpant extension version api community laravel podcast laravel5 language interview opinion example security list framework library

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