A symfony tip: Rename a symfony Application
Fabien Potencier
Nov 5, 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 toapps/frontend/.The second step is rename the functional test directory
test/functional/fo/totest/functional/frontend/.You can optionally rename the front controllers from
web/fo_*.phptoweb/frontend_*.php.Finally, you have to update the front controllers. By default, you have two file to update:
fo_dev.phpandfo.php(orindex.phpif this is the main application).Change the
APPconstant fromfotofrontend:[?php 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); require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); sfContext::getInstance()->getController()->dispatch();
You’re done. The old fo app name is now frontend.
Warning
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:
[txt]
.svn
/web/uploads/*
/cache/*
/log/*
/web/*_dev.php # <<-- All dev front controllers won't be deployed