Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.


Stack Overflow

The old fashioned way


July 16, 2007 – 11:57am Symfony init-batch

Before version 1.0 I was writing my batch scripts by hand, usually cutting and pasting from other batch scripts. At some point the


command became available. This is how it works:

symfony init-batch default [yourBatchName] [yourApplicationName]

This creates a new file in your project/batch directory with the following content:

 * yourBatchName batch script
 * Here goes a brief description of the purpose of the batch script
 * @package    yourProject
 * @subpackage batch
 * @version    $Id$
define('SF_ROOT_DIR',    realpath(dirname(__file__).'/..'));
define('SF_APP',         'yourApplicationName');
define('SF_ENVIRONMENT', 'dev');
define('SF_DEBUG',       1);
// initialize database manager
//$databaseManager = new sfDatabaseManager();
// batch process here

Nice! Credit goes to those who posted in the forum for details about this great command line tool.

Posted by in  Uncategorized   |  

2 Responses to Symfony init-batch

  1. Pingback: » A week of symfony #29 (16-&gt;22 July 2007)

  2. mo says:

    fyi – init-batch is gone in symfony 1.1

    look up how to create a task in symfony.