CakePHP应用程序部署 [英] CakePHP Application Deployment

查看:120
本文介绍了CakePHP应用程序部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣了解如何部署他们的CakePHP应用程序。我最近接触到了做一些自由的CakePHP开发,这将是一个很好的机会,让我获得一些经验的演示层(在我的FT工作我做业务和持久性层次的Java EE开发)。

I am interested in finding out how folks are deploying their CakePHP applications. I have recently been approached about doing some freelance CakePHP development, which would be a nice opportunity for me to get some experience in the presentation tier (in my FT job I do Java EE development in the business and persistence tiers).

我的想法在这一点上有点混乱,但我正在考虑以下情况:

My thoughts are a bit disorganized at this point, but I'm considering the following scenarios:


  • 在IDE中工作的开发人员修改文件,该文件自动(在后台)与本地运行的开发Web服务器同步。

  • Developer working in an IDE modifies a file, which is automatically (in the background) synchronized with a development web server running locally. This scenario is how I would ideally like to do development... make a change and be able to see the change in action without any extra steps.

开发人员(开发人员)在IDE中修改文件,该文件自动(在后台)通过FTP与远程运行的开发Web服务器同步。

Developer working in an IDE modifies a file, which is automatically (in the background) synchronized via FTP with a development web server running remotely. This scenario would be useful when I'm traveling using my netbook (which runs my IDE slowly enough as it is without a web server in the mix).

我最熟悉的开发工具是Eclipse, Ant和Subversion。

The development tools that I'm most comfortable with are Eclipse, Ant, and Subversion. My preference is to continue using those, but I would consider switching if doing so makes it easy to achieve the scenarios.

问题:


  • 这些合理的情况,还是我需要以不同的方式考虑开发和部署?

  • 帮助简化开发/部署?

  • 我们如何在部署期间处理数据库问题?如何为特定部署指定数据库连接属性?如果更新到较新版本(或恢复到较旧版本)的CakePHP应用程序需要更改数据库模式和数据迁移,该怎么办?

  • 如何配置不同的属性部署?例如,考虑增加开发过程中使用的调试和日志记录级别,防止在开发期间将付款发送到付款网关等。

  • 升级或恢复部署如何影响客户?例如,如果他们处于交易中(例如购买产品)?

  • 我们如何处理不同的CakePHP安装类型?根据安装类型,文件可能需要安装在不同的位置。我们如何知道应该在哪里安装文件? CakePHP书描述了开发,生产和高级安装。

  • Are these reasonable scenarios, or should do I need to think about development and deployment in a different way?
  • What tools exist that can help simplify development/deployment? Would it be better for me to roll my own solution with Ant, scripts, etc?
  • How do we handle database issues during deployment? How are database connection properties specified for a particular deployment? What if updating to a newer version (or reverting back to an older version) of the CakePHP application requires a change to the database schema and data migration?
  • How do we configure properties that vary between deployments? For example consider increased debug and logging levels used during development, preventing payments from being sent to payment gateways during development, etc.
  • How does upgrading or reverting a deployment affect customers? For example what if they are in the middle of a transaction (e.g. purchasing a product)?
  • How do we handle different CakePHP installation types? Files may need to be installed in different locations depending on the installation type. How can we know where files should be installed? The CakePHP book describes development, production, and advanced installations.

对于一个帖子中有这么多问题,

Sorry for so many questions in one post, but I think the questions are all related and thought it would be useful to keep the discussion in one place.

推荐答案


这些都是非常有用的合理的方案,或者我应该用不同的方式考虑开发和部署?

Are these reasonable scenarios, or should do I need to think about development and deployment in a different way?

似乎合理,我想起Dreamweaver。 :)

Seems reasonable, although the FTP synchronisation makes me think of Dreamweaver. :)

请考虑使用允许您通过(S)FTP连接到服务器的IDE,或使用以下其中一种...

Consider using an IDE that allows you to connect to a server over (S)FTP, or use one of the following...


有哪些工具可以帮助简化开发/部署?

What tools exist that can help simplify development/deployment? Would it be better for me to roll my own solution with Ant, scripts, etc?

Jenkins Capistrano Phing ,Ant, git push / pull rsync 等。

Jenkins, Capistrano, Phing, Ant, git push/pull, rsync, etc.


我们如何在部署期间处理数据库问题?如何为特定部署指定数据库连接属性?如果更新到较新版本(或恢复到较旧版本)的CakePHP应用程序需要更改数据库模式和数据迁移如何?

How do we handle database issues during deployment? How are database connection properties specified for a particular deployment? What if updating to a newer version (or reverting back to an older version) of the CakePHP application requires a change to the database schema and data migration?

使用蛋糕模式生成蛋糕模式运行更新


我们如何配置不同部署之间的属性?例如,考虑增加开发过程中使用的调试和日志记录级别,防止在开发过程中将付款发送到支付网关等。

How do we configure properties that vary between deployments? For example consider increased debug and logging levels used during development, preventing payments from being sent to payment gateways during development, etc.

(即 core.php.prd vs core.php.dev )并在安装时重命名。 / p>

Name files that differ accordingly (ie. core.php.prd vs core.php.dev) and rename on install.


升级或恢复部署如何影响客户?例如,如果他们是在交易中间(如购买产品)?

How does upgrading or reverting a deployment affect customers? For example what if they are in the middle of a transaction (e.g. purchasing a product)?

因此,您的应用程序文件不会结束在不一致的状态下,您应该首先检查应用程序的新副本到一个新的文件夹。复制任何用户提交的文件,重命名 *。prd 文件,然后切换旧副本与新副本(通过重命名或使用符号链接)。会话应存储在将在升级后生存的地方(即 php 数据库,而不是 cake )。

So your application files don't end up in an inconsistent state, you should begin by checking out a fresh copy of the application to a new folder. Copy across any user submitted files, rename *.prd files, and then switch the old copy with the new copy (by renaming or using symlinks). Sessions should be stored somewhere that will survive the upgrade (ie. php or database, rather than cake).


我们如何处理不同的CakePHP安装类型?根据安装类型,文件可能需要安装在不同的位置。我们如何知道应该在哪里安装文件? CakePHP书描述了开发,生产和高级安装。

How do we handle different CakePHP installation types? Files may need to be installed in different locations depending on the installation type. How can we know where files should be installed? The CakePHP book describes development, production, and advanced installations.

开发安装与使用 .htaccess 文件重定向请求(除非卸载/错误配置 mod_rewrite 和PHP),否则人们不会看到您的代码。生产安装稍微复杂一点,除非您可以编辑虚拟主机的文档根。高级安装允许您在文件系统中的任何位置安装Cake,但增加了更多的复杂性(因为您的文件位于两个独立的位置,但可能位于单个仓库中)

The development install is just as secure as any PHP application that uses .htaccess files to redirect requests (people won't see your code unless you uninstall/misconfigure mod_rewrite and PHP). The production install is slightly more complicated unless you can edit the document roots of your virtual hosts. The advanced install allows you to install Cake anywhere in the filesystem, but adds more complexity (since your files sit in two seperate locations, but may sit in a single repo)

这篇关于CakePHP应用程序部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆