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

IBuildings techPortal: Using PHP_CodeSniffer

Bruno Goncalves' Blog: Writting your first WordPress plugin

HowTo Forge: Installing The PHP-MSSQL Module On CentOS 5.0

Gonzalo Ayuso's Blog: Watermarks in our images with PHP and Gearman

JavaWorld: Web-less PHP: Command Line PHP

Community Events

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

yii2 symfony introduction composer api laravel programming community podcast php7 series opinion list framework interview application language project example part2

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