<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 20 Jun 2013 04:52:49 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[ServerGrove.com: Creating console commands with Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/15285</guid>
      <link>http://www.phpdeveloper.org/news/15285</link>
      <description><![CDATA[<p>
On the ServerGrove.com blog today there's <a href="http://blog.servergrove.com/2010/10/14/creating-console-commands-with-symfony2/">this new post</a> showing you how to create console commands with your <a href="http://symfony-reloaded.org/">Symfony2</a> codebase in addition to the normal websites you might have generated.
</p>
<blockquote>
<a href="http://symfony-reloaded.org/">Symfony 2</a> 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 <a href="http://www.symfony-project.org/">symfony 1.4.x</a> these were called <a href="http://www.symfony-project.org/gentle-introduction/1_4/en/16-Application-Management-Tools#chapter_16_sub_custom_tasks">tasks</a> and it was possible to create a skeleton by using the symfony generate:task task.
</blockquote>
<p>
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. <a href="http://blog.servergrove.com/2010/10/14/creating-console-commands-with-symfony2/">The post</a> includes this code example and how it looks when called from the command line.
</p>
]]></description>
      <pubDate>Fri, 15 Oct 2010 08:53:19 -0500</pubDate>
    </item>
  </channel>
</rss>
