brightlemon web design london [accesskey: .] brightlemon london web design
company services products support case studies training resources contact us
Web contact
Call me back
Request a quote
PQQs/RFPs

Search blog

Pages
  • About the Brightlemon web design london blog

  • Archives
  • August 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • December 2007
  • November 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006

  • Categories
  • Accessibility (16)
  • Adobe (3)
  • ajax (3)
  • Analytics (1)
  • Apache (9)
  • Blogs (5)
  • Brightlemon news (19)
  • case study (8)
  • command line (6)
  • content management (4)
  • CSS (28)
  • database administration (1)
  • Design (11)
  • Dreamweaver (12)
  • Drupal (34)
  • Drupal configuration (22)
  • Drupal courses (4)
  • Drupal customisation (20)
  • Drupal development (27)
  • Drupal modules (22)
  • Drupal optimisation (13)
  • Drupal regions (9)
  • Drupal scalability (11)
  • Drupal styling (12)
  • Drupal Themes (19)
  • Drupal training (6)
  • Drupal video (10)
  • Drupal views (10)
  • e-commerce (6)
  • Email (2)
  • Errors (5)
  • Firefox Add-Ons (6)
  • Flash (18)
  • FTP (5)
  • HTML (20)
  • Illustrator (13)
  • Information Architecture (4)
  • Internet Security (10)
  • JavaScript (9)
  • javascript (3)
  • jquery (2)
  • LAMP (10)
  • Linux (12)
  • mathematics (3)
  • maths (3)
  • mobile web (2)
  • mysql (7)
  • Open Source (15)
  • Photoshop (22)
  • php (15)
  • Quality Assurance (4)
  • research & strategy (5)
  • Search engine optimisation (8)
  • seo (7)
  • Server administration (7)
  • Smarty (1)
  • social bookmarking (5)
  • social networking (15)
  • social tagging (4)
  • ssh (3)
  • subversion (2)
  • svn (1)
  • Tips (23)
  • typography (3)
  • Uncategorized (1)
  • Unix (4)
  • Usability (4)
  • Useful Links (14)
  • version control (1)
  • W3C (17)
  • Web 2.0 (44)
  • Web browsers (18)
  • Web design (84)
  • Web development (133)
  • Web marketing (5)
  • Web standards (12)
  • Web video (8)
  • xhtml (3)
  •       go - (© brightlemon web design london)
    « Typography 01 :: Font Basics - What Is X-Height, Leading, Kerning, Tracking, Ascender, Descender Introduction to Ajax »

    Checkout SVN with PHP

    Subversion (SVN) is a version control system that allows multiple developers to work on code simultaneously without coming into conflict (further information on SVN can be found on Wikipedia). Here at Brightlemon we find ourselves working on ever more complex sites and SVN has become a very useful tool that, if required, allows all staff to work on a site at any one time. We use a windows SVN client called Tortoise SVN so that we can work remotely on code and then commit to a central SVN repository.

    When it comes to updating a site by checking out the code from a repository we usually run commands via an SSH shell connection, however we have found recently that when we are working with external companies (and even for new staff) then it useful to have an additional method for checking out the code that does not require SSH access to a server. We have achieved this by creating a PHP script that executes SVN commands in the following way. In order to use a PHP script that can run SVN commands you must ensure that your apache user (normally called ‘www-data’) has sufficient permissions to:

    1. create and edit folders
    2. run SVN commands

    Your PHP script should then contain the following: // svn checkout command $checkout = "svn --username SVN-USERNAME --password SVN-PASSWORD checkout http://SVN-REPOSITORY-LOCATION DESTINATION-FOLDER"; // run php exec command exec($checkout);

    You should replace the following with your own values:

    1. SVN-USERNAME - the username you use to connect to your SVN repository
    2. SVN-PASSWORD - the corresponding password you use to connect to your SVN repository
    3. SVN-REPOSITORY-LOCATION - the URL location of the respository you are checking out
    4. DESTINATION-FOLDER - the location on the server where the repository should be checked out to (if omitted the basename of the URL will be used as the destination).

    You should save this as a file called ‘checkout.php’ on your webserver. Then using this script anyone (with access to this page) can checkout your SVN repository without requiring any knowledge of shell or SVN commands by opening the following URL in a browser http://your-domain.com/checkout.php.

    This entry was posted on Tuesday, May 20th, 2008 at 12:04 pm and is filed under Web development, Open Source, Tips, php, Apache, svn, subversion, version control. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

    Comments are closed.

    social networking
    e-commerce
    search engine optimisation
    web design
    content management
    accessibility
    brightlemon london web design
    UK and London web site visitors

    Visiting from the UK or London? Visit our London web site...