您如何管理PHP项目开发生命周期?

时间:2023-01-26 09:15:53

I've worked on several PHP projects and always I have problems with organizing my work. Where do you develop your application - on localhost, remote server or maybe production one(!) ? When I work on my localhost after making some major path I send new files by ftp - but sometimes it happens to forget about one file and it is just tiring to browse several directiores to copy changed files. What best practises do you propose?

我曾经参与过几个PHP项目,总是在组织工作时遇到问题。你在哪里开发你的应用程序 - 在localhost,远程服务器或生产一个(!)?当我在制作一些主要路径后在我的本地主机上工作时,我通过ftp发送新文件 - 但有时它恰好忘记了一个文件,浏览几个directiores来复制更改的文件真的很累。您提出了哪些最佳做法?

5 个解决方案

#1


10  

This is how we manage our commercial site:

这就是我们管理商业网站的方式:

  1. Develop in a local sand box
  2. 在当地沙箱中开发

  3. Check-in to SVN
  4. 登记SVN

  5. Automated build/test from SVN onto internal dev server
  6. 从SVN到内部开发服务器的自动构建/测试

  7. Scripted deploy using rsync to staging server for QA/UAT
  8. 使用rsync进行脚本部署到QA / UAT的登台服务器

  9. Scripted deploy onto production servers.
  10. 脚本部署到生产服务器上。

Staging and production servers are both hosted by the ISP and are hardware and version matched and run RHEL, internal Dev server is version matched CentOS.

暂存和生产服务器都由ISP托管,并且硬件和版本匹配并运行RHEL,内部Dev服务器与版本匹配的CentOS。

This way, when code hits the production servers there shouldn't be any nasty surprises as even the deploy scripts get checked in stage 4.

这样,当代码命中生产服务器时,不应该有任何令人讨厌的意外,即使在第4阶段检查部署脚本也是如此。

#2


1  

Google App Engine has an apposite tool that automatically uploads to the production environment files that are modified; don't know if there's something similar for PHP. So, doing a dev2prod script (a script that does this automatically) should be a good solution.

Google App Engine有一个适当的工具,可以自动上传到生产环境中的文件被修改;不知道PHP是否有类似的东西。因此,执行dev2prod脚本(自动执行此操作的脚本)应该是一个很好的解决方案。

To do local source file management, everyone may suggest you to use a source code control system.

要进行本地源文件管理,每个人都可能建议您使用源代码控制系统。

#3


0  

I'm developing on a development machine which has an identical enviroment like the production one - that prevents some different behaviour because of different versions or configs. after finishing i just move all the files on to the production server.

我正在开发一台开发机器,它具有与生产机器相同的环境 - 由于不同的版本或配置而阻止了一些不同的行为。完成后我只需将所有文件移动到生产服务器上。

Winmerge is a nice and free windows tool to diff your files between development and production machine.

Winmerge是一个很好的免费Windows工具,可以在开发和生产机器之间区分文件。

#4


0  

Develop in your local machine with the same exact configuration as your development enviroment (that is apache mods, php extensions and so on), using a version control system (I prefer SVN) to keep track of modified files and what not.

使用与开发环境相同的配置(即apache mods,php扩展等)在本地计算机上进行开发,使用版本控制系统(我更喜欢SVN)来跟踪修改后的文件,以及不是。

Then you can write a script in your production or testing enviroment to copy/update files off the repository to the web server path.

然后,您可以在生产或测试环境中编写脚本,以将文件从存储库复制/更新到Web服务器路径。

#5


0  

Probably get told off for redirecting an old post but here's how I do it using free tools:

可能会被告知重定向旧帖子,但这是我如何使用免费工具执行此操作:

I use Netbeans, Git, bitbucket, source tree, gitflow and FTPloy.

我使用Netbeans,Git,bitbucket,source tree,gitflow和FTPloy。

Bitbucket.com : sign up for free account. SourceTree: free from bitbucket. Great tool for managing git repositories. All commits, merges and pulls can be done in here. Issues in bitbucket can be tracked.

Bitbucket.com:注册免费帐户。 SourceTree:免于bitbucket。管理git存储库的好工具。所有提交,合并和拉取都可以在这里完成。可以跟踪bitbucket中的问题。

In sourcetree, take the master branch and click "git flow" - google gitflow - it's fantastic work flow of feature, hotfix, development, and release branches and sourcetree helps automate the process.

在sourcetree中,选择master分支并单击“git flow” - google gitflow - 它是功能,修补程序,开发和发布分支的极佳工作流程,sourcetree有助于自动化该过程。

FTPloy.com automates the deployment of your master branch. Free is one repo/server. But worth the upgrade if you want to push development branch to a server sandbox for testing.

FTPloy.com自动部署主分支。免费是一个回购/服务器。但是,如果您想将开发分支推送到服务器沙箱进行测试,那么值得升级。

Hope this helps someone searching the web!

希望这可以帮助搜索网络的人!

#1


10  

This is how we manage our commercial site:

这就是我们管理商业网站的方式:

  1. Develop in a local sand box
  2. 在当地沙箱中开发

  3. Check-in to SVN
  4. 登记SVN

  5. Automated build/test from SVN onto internal dev server
  6. 从SVN到内部开发服务器的自动构建/测试

  7. Scripted deploy using rsync to staging server for QA/UAT
  8. 使用rsync进行脚本部署到QA / UAT的登台服务器

  9. Scripted deploy onto production servers.
  10. 脚本部署到生产服务器上。

Staging and production servers are both hosted by the ISP and are hardware and version matched and run RHEL, internal Dev server is version matched CentOS.

暂存和生产服务器都由ISP托管,并且硬件和版本匹配并运行RHEL,内部Dev服务器与版本匹配的CentOS。

This way, when code hits the production servers there shouldn't be any nasty surprises as even the deploy scripts get checked in stage 4.

这样,当代码命中生产服务器时,不应该有任何令人讨厌的意外,即使在第4阶段检查部署脚本也是如此。

#2


1  

Google App Engine has an apposite tool that automatically uploads to the production environment files that are modified; don't know if there's something similar for PHP. So, doing a dev2prod script (a script that does this automatically) should be a good solution.

Google App Engine有一个适当的工具,可以自动上传到生产环境中的文件被修改;不知道PHP是否有类似的东西。因此,执行dev2prod脚本(自动执行此操作的脚本)应该是一个很好的解决方案。

To do local source file management, everyone may suggest you to use a source code control system.

要进行本地源文件管理,每个人都可能建议您使用源代码控制系统。

#3


0  

I'm developing on a development machine which has an identical enviroment like the production one - that prevents some different behaviour because of different versions or configs. after finishing i just move all the files on to the production server.

我正在开发一台开发机器,它具有与生产机器相同的环境 - 由于不同的版本或配置而阻止了一些不同的行为。完成后我只需将所有文件移动到生产服务器上。

Winmerge is a nice and free windows tool to diff your files between development and production machine.

Winmerge是一个很好的免费Windows工具,可以在开发和生产机器之间区分文件。

#4


0  

Develop in your local machine with the same exact configuration as your development enviroment (that is apache mods, php extensions and so on), using a version control system (I prefer SVN) to keep track of modified files and what not.

使用与开发环境相同的配置(即apache mods,php扩展等)在本地计算机上进行开发,使用版本控制系统(我更喜欢SVN)来跟踪修改后的文件,以及不是。

Then you can write a script in your production or testing enviroment to copy/update files off the repository to the web server path.

然后,您可以在生产或测试环境中编写脚本,以将文件从存储库复制/更新到Web服务器路径。

#5


0  

Probably get told off for redirecting an old post but here's how I do it using free tools:

可能会被告知重定向旧帖子,但这是我如何使用免费工具执行此操作:

I use Netbeans, Git, bitbucket, source tree, gitflow and FTPloy.

我使用Netbeans,Git,bitbucket,source tree,gitflow和FTPloy。

Bitbucket.com : sign up for free account. SourceTree: free from bitbucket. Great tool for managing git repositories. All commits, merges and pulls can be done in here. Issues in bitbucket can be tracked.

Bitbucket.com:注册免费帐户。 SourceTree:免于bitbucket。管理git存储库的好工具。所有提交,合并和拉取都可以在这里完成。可以跟踪bitbucket中的问题。

In sourcetree, take the master branch and click "git flow" - google gitflow - it's fantastic work flow of feature, hotfix, development, and release branches and sourcetree helps automate the process.

在sourcetree中,选择master分支并单击“git flow” - google gitflow - 它是功能,修补程序,开发和发布分支的极佳工作流程,sourcetree有助于自动化该过程。

FTPloy.com automates the deployment of your master branch. Free is one repo/server. But worth the upgrade if you want to push development branch to a server sandbox for testing.

FTPloy.com自动部署主分支。免费是一个回购/服务器。但是,如果您想将开发分支推送到服务器沙箱进行测试,那么值得升级。

Hope this helps someone searching the web!

希望这可以帮助搜索网络的人!