News Feed
Jobs Feed
Sections




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

ServerGrove.com:
Creating console commands with Symfony2
October 15, 2010 @ 08:53:19

On the ServerGrove.com blog today there's this new post showing you how to create console commands with your Symfony2 codebase in addition to the normal websites you might have generated.

Symfony 2 is mainly used to create web application, however, sometimes you need to extend your app and need a command line tool to help perform tasks around the application. With symfony 1.4.x these were called tasks and it was possible to create a skeleton by using the symfony generate:task task.

While there's not a tool for it, Symfony2 does offer something called "Commands" as a sort of replacement. A basic skeleton of one is included with the framework, there's just no auto-generation tool for them (yet). The basic one, TestCommand.php, shows you how to set up a command's name, arguments and some parameter mapping. The post includes this code example and how it looks when called from the command line.

0 comments voice your opinion now!
console command symfony2 taks commandtest tutorial


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Getting started writing ZF2 modules

PHPMaster.com: REST - Can You do More than Spell It? Part 3

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 1)

Lukas Smith's Blog: Symfony2, what I think is still left to do

Developer.com: PHP 5 OOP - Delegation and Custom Exceptions


Community Events











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


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

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