我已经差不多完成了一个用 Symfony2 开发的项目的开发,希望把项目放到网上。
但是,我想有很多事情需要做才能让一切正常。我想,需要禁用开发模式等......需要做什么以及如何做?
我已经差不多完成了一个用 Symfony2 开发的项目的开发,希望把项目放到网上。
但是,我想有很多事情需要做才能让一切正常。我想,需要禁用开发模式等......需要做什么以及如何做?
我建议您使用Capifony进行部署。它做了很多开箱即用的东西,你可以让它运行你需要的任何自定义命令。有关详细信息,请参阅其文档。
关于开发模式,除非您已从 中删除 IP 检查,否则您app_dev.php
不必担心部署它。当然,如果您愿意,您可以告诉 Capifony 在部署时将其删除。
Im currently researching the same thing.
The first thing you have to consider is "how professional" you want to deploy. There are a lot of tools you can use:
I think the simplest setup is using only a Build tool and i guess you are already using some kind of versioning.
Depending on which tool you use, the setup is different, but I think there are some things you should consider with your application (maybe not all are applicable to your application)
These are the things I currently need for my application for production deployment, if you deploy to an test environment you should load fixtures and run your testscripts as well.
处理部署的最佳方式是创建“构建”脚本,它将:
app_dev.php
文件app/cache
是app/logs
完全可写/可读的。然后,在部署之前,您应该在项目中创建标签 - 这意味着您的应用程序的某个版本已发布(我建议遵循此git 分支模型)。
这里很好地描述的另一个选项是使用Apache Ant部署 Symfony2 应用程序。Apache Ant是一个 Java 库和命令行工具,其任务是驱动构建文件中描述的进程作为相互依赖的目标和扩展点。