A symfony tip: Rename a symfony Application

Fabien Potencier

November 05, 2007

Renaming a symfony application is quite simple.

Here are the steps to follow to rename a fo symfony application to frontend:

  • The first obvious step is to rename the apps/fo/ directory to apps/frontend/.

  • The second step is rename the functional test directory test/functional/fo/ to test/functional/frontend/.

  • You can optionally rename the front controllers from web/fo_*.php to web/frontend_*.php.

  • Finally, you have to update the front controllers. By default, you have two file to update: fo_dev.php and fo.php (or index.php if this is the main application).

    Change the APP constant from fo to frontend:


    define('SF_ROOT_DIR',    realpath(dirname(__FILE__).'/..'));
    define('SF_APP',         'frontend'); // <<-- I've changed fo to frontend here
    define('SF_ENVIRONMENT', 'dev');
    define('SF_DEBUG',       true);



You're done. The old fo app name is now frontend.

If you use the symfony sync task to deploy your project, check that your development front controllers are not deployed. This is the case if you have a recent default rsync_exclude.txt file:

 /web/*_dev.php # <<-- All dev front controllers won't be deployed