简体   繁体   English

部署Symfony 1.4项目

[英]Deploying Symfony 1.4 project

I have recently developed a project which is written using Symfony 1.4 which I installed through PEAR. 我最近开发了一个使用Symfony 1.4编写的项目,该项目是通过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. 在之前的Symfony版本中,曾经有冻结解冻功能来复制所有必需的文件,但在这个版本中缺少这些功能。 So my question is - what is the fastest way to deploy my project on a shared hosting? 所以我的问题是-在共享主机上部署项目的最快方法是什么?

Shared hosting is always a pain with Symfony. 共享托管对于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. 但是,您可以做的只是将symfony安装目录中的lib文件夹复制到项目lib文件夹中,然后将projectConfiguration.php指向将symfony库放入项目的位置。

This just does the same thing as the freeze but manually. 这只是与冻结相同但手动完成。

In your config/ProjectConfiguration.class.php change the require_once statement for sfCoreAutoload class. 在您的config / ProjectConfiguration.class.php中,更改sfCoreAutoload类的require_once语句。 Make it search for symfony in lib/vendor/symfony : 使它在lib / vendor / symfony中搜索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. 将整个symfony lib复制到lib / vendor / symfony dir中。 This way you always have symfony with your project. 通过这种方式,您始终可以在项目中使用symfony。 Drawback is you have to copy it while sending files to the server. 缺点是在将文件发送到服务器时必须复制它。
  • Create lib/vendor/symfony symbolic link pointing to your symfony lib. 创建指向您的symfony lib的lib / vendor / symfony符号链接。 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. 缺点是您仍然必须将symfony放在开发服务器和生产服务器上的同一位置。 However, symbolic link might be relative to the project (ie one level up). 但是,符号链接可能相对于项目(即上一级)。

@kuba, your statement in config/ProjectConfiguration.class.php has one 'lib' too many. @kuba,您在config / ProjectConfiguration.class.php中的语句有太多“ lib”。 It should be: 它应该是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM