部署Symfony 1.4项目

问题描述:

I have recently developed a project which is written using Symfony 1.4 which I installed through PEAR. In previous Symfony versions there used to be freeze and unfreeze functions to copy all the necessary files, but in this versions these functions are missing. So my question is - what is the fastest way to deploy my project on a shared hosting?

我最近开发了一个项目,它是使用我通过PEAR安装的Symfony 1.4编写的。 在以前的Symfony版本中,曾经有冻结 strong>和解冻 strong>函数来复制所有必需的文件,但在这个版本中,这些函数都缺失了。 所以我的问题是 - 在共享主机上部署项目的最快方法是什么? p> div>

In your config/ProjectConfiguration.class.php change the require_once statement for sfCoreAutoload class. Make it search for symfony in lib/vendor/symfony:

require_once dirname(__FILE__) . '/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';

Now you can do two things:

  • Copy whole symfony lib into lib/vendor/symfony dir. This way you always have symfony with your project. Drawback is you have to copy it while sending files to the server.
  • Create lib/vendor/symfony symbolic link pointing to your symfony lib. Advantage is you don't have to copy whole framework all the time. Drawback is you still have to put symfony in the same location on dev and production servers. However, symbolic link might be relative to the project (i.e. one level up).

Shared hosting is always a pain with Symfony. I haven't attempted it myself. But what you can do is just copy the lib folder from your symfony installation into your project lib folder and just point your projectConfiguration.php to where you put the symfony libs in your project.

This just does the same thing as the freeze but manually.

@kuba, your statement in config/ProjectConfiguration.class.php has one 'lib' too many. It should be:

require_once dirname(__FILE__) . '/../lib/vendor/symfony/autoload/sfCoreAutoload.class.php';