Integrated development using subversion for PHP
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 sh开发者_开发问答ould 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..
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.
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.
精彩评论