使用 Subversion 进行 PHP 集成开发
我们两个人在一个团队中从事同一个项目。我的是MAC版,另一个是PC版。我以前从未使用过 SVN。谷歌搜索 SVN 让我对 svn 有基本的了解。我的理解是应该在客户端机器上安装 subversion(我不知道哪个客户端,我假设有很多类似的版本和 mac 的基石,windows 的 tortoise 等。我需要一个存储库,我将在其中托管集中版本客户端将获得代码或文件的副本,他们可以在其中将更改提交到存储库(主应用程序),但我不明白的是,因为我们的 PHP 代码使用数据库(在我的例子中是 mysql)它是如何管理的通过 SVN 客户端?
最后我希望我的开发环境能够通过以下方式实现
我想同时将我的 mac 设置为 SVN 的开发服务器 。 我想在同一台机器上使用 SVN 工作。
PC 应从 MAC 访问存储库并提交更改。
所有设置都应通过 LAN 在本地完成和实施。如果我对 svn 的理解有误,请纠正我,并指导我在两台机器上安装所需的要求和资源,以便我开始在我的项目中使用 SVN。
谢谢..
We are two in a team working on the same project. i am on MAC and the other one is on PC. i have never used SVN before. googling about the SVN gave me basic understanding about svn. and what i understood is there should be subversion installed in client machine (i do not know which client, i assume there are many like versions and cornerstone for mac, tortoise for windows etc. and i require a repository where i will host the centralized version of the application. the client will get the copy of codes or files where they can commit the changes to repository (main application). which can be undone if required. however what i don't understand is, as our PHP code uses database(mysql in my case) how is it managed by SVN client?
lastly i expect my development environment to be implemented the following way.
i want to set up my mac as development server for SVN at the same
time i would like to work in the same machine making use of SVN.PC should access the repository from MAC and commit the changes.
all the setup should be done and implemented locally via LAN. please correct me if i am wrong on my understanding about the svn and also do guide me about the requirements and resources i need to install in both the machine for me to get going using SVN for my projects.
thank you..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 Mac 来托管 SVN 存储库,也可以将其用作客户端来签出您的工作副本。看看这个链接(它有点旧,但你'会明白要点)。
一旦您设置了 SVN 存储库,您就可以对其启用 HTTP 访问,以便您的合作伙伴可以签出副本并向其提交更改。请查看此处了解如何为存储库启用 HTTP 访问。
大多数现代 PHP 框架使用迁移脚本来帮助构建和维护数据库架构,如果可能的话使用框架。查看其中一个框架的迁移脚本以获取灵感(即,如果您不能使用框架)。迁移脚本在后台触发
create table
或alter table
命令,您所做的就是将迁移文件添加到 SVN 存储库以对数据库架构进行版本控制。在 Mac 上托管 SVN 存储库的一个警告是,如果由于某种原因发生故障,您的合作伙伴将陷入困境,因为无法提交代码更改并且无法签出新更改。查看此线程,了解免费的在线私有 SVN 存储库。如果您想走付费路线,GitHub.com 非常棒。
You can use your Mac both for hosting your SVN repository and also use it as the client to checkout your working copy. Have a look at this link (its slightly old but you'll get the gist).
Once you have the SVN repository setup you can enable HTTP access on it so that your partner can checkout the copy and commit changes to it. Have a look here on how to enable HTTP access for your repository.
Most modern day PHP Frameworks use migrations scripts that help in building and maintaining your database schema, if possible use a framework. Have a look at the migrations script of one of the frameworks for inspiration (i.e if you can't use a framework). Migration scripts under the hood fire
create table
oralter table
commands, and all you do is add the migration files to your SVN repository to version control your database schema.One caveat with hosting the SVN repository on your Mac is that for some reason if its down, your partner gets stuck as code changes can't be committed and new changes can't be checked out. Have a look at this thread for free online private SVN repositories. In case you want to go the paid route GitHub.com is awesome.
我自己开发并使用 http://www.springloops.com 上托管的存储库。在这里,我只是将数据库导出到文本文件,并保留对数据库的历史更改。显然,这不适合在项目上一起工作的团队,除非您在记录数据库更改方面进行了很好的协调。
这个问题看起来很有用 MySQL Version Control - Subversion 尽管它特定于 mysql subversioning - 不完全是答案对于你更广泛的问题。
每台机器都应该有相关的客户端软件,我推荐Tortoise SVN for Windows - 它非常受欢迎。肯定有一个类似的 OSX SVN 客户端可供您使用。
I develop on my own and use a repository hosted on http://www.springloops.com. On here I just export the database to a text file and keep historic changes to the database on there. Clearly this is not suitable for a team working together on a project unless you're well coordinated in recording your database changes.
This question looks useful MySQL Version Control - Subversion though it's specific to mysql subversioning - not quite the answer to your broader question.
Each machine should have the relevant Client software, I recommend Tortoise SVN for Windows - it's pretty popular. There is bound to be a similar alternative SVN Client for OSX that you can get your hands on.