Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename "web" folder in Symfony 1.4

I want to rename the "web" folder to "html" in symfony 1.4, unfortunately searching for documentation on this has lead me nowhere except for how this would be accomplished in 1.0, which does not seem to be working.

like image 986
thisisrobv Avatar asked Oct 15 '10 23:10

thisisrobv


2 Answers

Firstly, you don't have to rename it. You can just create a symbolic link (unless you're running windows):

ln -s web html

If you still want to change the web folder name than you could do it in your project's ProjectConfiguration class by overloading setRootDir():

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setRootDir($rootDir)
  {
    parent::setRootDir($rootDir);

    $this->setWebDir($rootDir . DIRECTORY_SEPARATOR . 'html');
  }
}
like image 85
Jakub Zalas Avatar answered Oct 15 '22 04:10

Jakub Zalas


kuba's answer is along the right lines, but I think it is cleaner to use setWebDir within setup:

class ProjectConfiguration extends sfProjectConfiguration
{
    public function setup()
    {
        $this->setWebDir($this->rootDir . '/html');
    }
}

I would generally prefer not to use a symlink, because it clutters up the root folder.

like image 33
lonesomeday Avatar answered Oct 15 '22 05:10

lonesomeday