News Feed
Sections




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

Igor Wiedler: Introducing Stack

Eric Adams' Blog: Implementing the Observer Pattern with SplObserver and SplSubject

Nefarious Designs: Object-Oriented PHP Part 4: PHP5's Improved Features

Andy Bakun's Blog: Race Conditions with Ajax and PHP Sessions

Symfony News: Translation Component Now Avabilable (Symfony2)


Community Events





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


language opinion laravel deployment framework introduction library community package tips podcast list voicesoftheelephpant interview api bugfix install release series symfony

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