SitePoint Sponsor

User Tag List

Results 1 to 21 of 21

Thread: version control

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Fredericton NB
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    version control

    About a year ago I started an application for three clients to manage their web sites. This has become a very complex application and I have completely rewritten it twice now. We just launched the new version last week and it is being used by about 40 clients.

    Over the past year my PHP skills, and programming ability in general, has grown in leaps and bounds. The application is 90% object oriented and has a very flexible interface that is easily changed, with dynamic navigation, etc.

    The one thing I am struggling with, however, is version control. My initial plan was to simply keep a copy of the application and database on the server for development and testing purposes, and move all the files into the production directory when it was deemed bug free and functional.

    Unfortunately, I now have a mess on my hands where I have a copy of the application where I am trying to add features. At the same time, minor issues are being solved on the production version, so some of the files are now out of sync. If this was a five or six page site that would be fine, but I have several hundred PHP files so it is no easy task to keep track of what has been updated when.

    So my question is, are there any easy solutions to version control when developing PHP applications?
    Red Cow Technologies, Inc
    RealAdmin - Software For Real Estate Agents
    myBusinessAdmin - Affordable CMS and web design solution.

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cvs
    and check out this book.
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by Ray Oliver
    So my question is, are there any easy solutions to version control when developing PHP applications?
    Short ansawer is CVS as Jason said.

    The long answer is there are two types. The older style (RCS, SourceSafe) use a pessimistic system whwre checked out code is locked. With more than about two developers this is way too restrictive.

    Newer optimistic systems allow anyone to check out any time and when you check in attempt to merge the code. This sounds like a headlong rush to disaster, but actually works really really well. Always use an optimistic system if you can. CVS is the lowest common denominator and has more than a few quirks. If you have a friend who has used it before, you will save yourself time. However it is free, comes bundled with Linux and Cygwin, often has IDE support and is stable in the industrial strength use of the word (Sourceforge lives on it). Doesn't have truly atomic commits, so it pays to tag inch stones.

    If you use Windows, WinCvs will save you some of the irritation.

    Commercial systems add the necessary gloss. Perforce is recommended by people who use it (I've not tried it).

    One question. Man, why haven't you done this before ? The extra couple of days you spend setting up CVS will pay for itself within a week (easily) and pay again every week thereafter. We use it all the time for application deployment (release), source control, versioning and developer communication. Boy are you going to kick yourself .

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  4. #4
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    The older style (RCS, SourceSafe) use a pessimistic system whwre checked out code is locked. With more than about two developers this is way too restrictive.
    That depends on the organization of your code and the organization of your team. I might place the breakdown point of RCS at > 2. I've used RCS (and later the commercial variant Source Integrity) on a team with a dozen active programmers with very few problems.

    That said, I would not recommend a pessimistic system at all on any team with more than one developer. This is because the pessimistic lock model promotes a code ownership philosophy which can be a bad thing.

    I think continuous integration is harder with a pessimistic system as well because changes to volatile files are not interleaved in real time, but in stages. In theory, it should be the reverse, but I have found in practice this is not the case.

    Capers Jones says that the failure to use version control should be considered professional malpractice.

    If you don't want to learn how to setup and manage CVS, there are commercial CVS service providers that do for private software what sourceforge does for open source.

    Your biggest issue with version control will depend on how you deploy to your clients.

    Do all of your clients run the same version of the software?

    Do you upgrade all of your clients simultaneously with new version, or are different clients running different versions?

    Who drives the upgrade process, you or your clients?

    I've found that version control software (especially the high end commercial packages) offer technical solutions to political problems, an a approach that rarely works. Thus, its best to avoid most of the so called advanced features and stick to the very basic features. For this reason I would recommend CVS over almost any commercial offering on price alone. (except service based offerings)

  5. #5
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you think about subversion ?
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  6. #6
    SitePoint Zealot sike's Avatar
    Join Date
    Oct 2002
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from what i have read subversion is superior to cvs. it takes away some pain using cvs (rename dirs etc). currently i am trying to build the standalone server to play around with it. if i get this stuff working i will post some impressions.

    Sike

    ps. man linux is great... but i am not ;[

  7. #7
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pippo
    What do you think about subversion ?
    Big especially with TortoiseSVN on Windows

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  8. #8
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Fredericton NB
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the answers guys.

    First off, right now, I'm the only developer working on this application so that is not an issue.

    I will have to look into CVS. I use a Mac (OS X), how does that change things? Also, I do most of my coding in Dreamweaver, does that matter?

    I feel like an idiot never having looked into this before.
    Red Cow Technologies, Inc
    RealAdmin - Software For Real Estate Agents
    myBusinessAdmin - Affordable CMS and web design solution.

  9. #9
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure the OpenSource blogger will help more,
    but these links would help too:
    http://www.macdevcenter.com/pub/a/ma...07/15/cvs.html
    http://www.macdevcenter.com/pub/a/ma...ntrol_one.html
    http://www.macdevcenter.com/pub/a/ma...ntrol_two.html
    http://www.macdevcenter.com/pub/a/ma...ntrol_two.html

    Remember that CVS sees all files as text files, as default.
    You should specify what kind of files should be treated as binary ( don't remember how, though ).
    ( If I remember right you can use a .cvs* file to specify which extensions are binary files, or you have to use a flag from the command line )
    Subversion automatically sees if a file is in binary format.

    Also take care that CVS stores the binary files in the repository ``entirely'',
    I read so.

    I mean if you edit an image of 100kb ten times and then you do ten commit...the total size occupied in the respository will be 10 * 100kb.

    Subversion has a diff alghorithm for binary files so it won't save a new copy each time.

    I'm not against CVS, I'm only making some thoughts because I need to make a choice me too

  10. #10
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At home I am the only developer working on my projects
    I started using RCS for version control, but found it to be a pain. Started using CVS and I have never looked back. Subversion looks good to, but it does not hurt to have cvs skills, as many more open source repositories provide hosting for cvs than subversion at the moment.

    Here is my "cvs bootstrap" recomendatations:

    This allows you to easily add new files to a cvs sandbox:
    Code:
    alias cvsaddnew='cvs add $(cvs up | grep "?" | cut -d " " -f 2)'
    The cvs command line will allow you to specify default parameters for the command line utilities. These defaults are stored in the .cvsrc file in your home directory.
    My recommended settings for your .cvsrc
    Code:
    diff -c
    update -P
    cvs -q
    Good luck.

  11. #11
    SitePoint Zealot sike's Avatar
    Join Date
    Oct 2002
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by seanf
    Big especially with TortoiseSVN on Windows

    Sean
    +1

    after fighting with linux and installing the server it worked like a snap.
    TortoiseSVN is really a time saver (just rightclick and do what you want)

    Sike

  12. #12
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THanks,
    could you suggest a GUI tool like Tortoise for a Linux Desktop ?

  13. #13
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd say definitely go with subversion. I just compiled, installed, and set it up on my linux server (as a stand-alone server). Easy and straight-forward. SVN's docs are great. Opted to upgrade BerkeleyDB, which it uses (easy to do as well). Then installed TortoiseSVN on my Windows machines. Everything appears to be working fine. Subversion feels a lot like CVS, except referring to projects is different (urls and directories as opposed to server and project name), as are tagging and branching, plus repositories and sandboxes are laid out different. It all seems pretty slick, powerful, and feature rich.

  14. #14
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by csn
    I'd say definitely go with subversion.
    The killer question - how easy is it to port CVS repositories to SubVersion?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  15. #15
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I convert an existing CVS repository into a Subversion repository?

    Members of the Subversion development community created and maintain a tool called cvs2svn. You can find it at http://cvs2svn.tigris.org/. Note that it is still under development, so only use it on a copy of your CVS repository and double check your results. Be sure to read the README.

    If cvs2svn.py does not work for you, (e.g. your repository causes it to crash, or it doesn't deal with branches and tags quite how you would like), there are at least two other conversion utilities you can try. These have different features (and possibly different bugs):

    * One based on VCP written by Chia-liang Kao can be found http://svn.clkao.org/revml/branches/svn-perl/.
    (Documentation at http://svn.clkao.org/revml/branches/...CP/Dest/svn.pm.)
    * refinecvs written by Lev Serebryakov is at http://lev.serebryakov.spb.ru/refinecvs/.

    See also the Subversion links page.
    http://subversion.tigris.org/project_faq.html#cvs2svn

  16. #16
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    I'll take that as a "no" then .

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  17. #17
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No to what? What was your yes/no question?

    It appears it's possible, maybe even easy. I don't know, as I haven't tried converting yet.

  18. #18
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by csn
    No to what?
    Sorry, misread my own question. I think no, I won't attempt it right now. I would need a lot of really good reports saying the ports were absolutely perfect. Too much is tied up with the code repositories until then.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  19. #19
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cocoon, a project of the ApacheSoftwareFoundation, repository moved from CVS to subversion:
    http://wiki.cocoondev.org/Wiki.jsp?p...rsionMigration

    The cocoon mailing list should contain discussions about that, such as:
    http://marc.theaimsgroup.com/?l=xml-...2246311464&w=2

    Maybe if I were you I would start only a new project with subversion, making pratice with it and then move in the future the old ones.

  20. #20
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Supervision - a Java/Swing based visual client for Subversion:
    http://supervision.tigris.org

    svn-up - Java client gui for subversion and plugin for idea ide:
    http://svnup.tigris.org

    Projects using both cvs and svn:
    http://svn.debian.org

  21. #21
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "Xiph.org has switched from CVS to using Subversion."

    http://www.icecast.org/svn.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •