SVN update made easy

subversion logoPHP Subversion Updater

In our company we use Subversion for version control.

Using a GUI for Mac gives our more graphical team members easy access to common tasks, such as committing changed files to the repository.

However updating the working copy on a (test-) web server still requires knowlegde of a unix shell and having to log in and running it manually can be a full time position.

After doing some research I found the official PECL SVN bindings. These are still very experimental and a hussle to install.

So I decided to use the simplest solution that just executes a “svn up” on the server and does not require any server-side modification:

exec("svn up ".dirname(__FILE__), $out, $ret);

Which serves perfectly for this purpose.

Wrapping this line in a (30secs) self refreshing file makes sure the working copy stays updated.

And the best thing is:
it does not require anything, except installed svn binaries that are executable for the apache user and write access to the webroot.
Download

May 25th, 2009 / Tech Talk / tim

3 Responses to “SVN update made easy”

  1. William says:

    genius fella!

  2. Rob says:

    Sweet as! thanks for this mate, was hittin SVN with a spanner, this solved my problem.

  3. [...] my previous post I explained how to build SVN updater script in PHP. This works fine on hosts that allow the [...]

Leave a Reply