Comments Blog About Development Research Sites

SVN integration for PHP with pvp_svn

Jul 10, 2011
There exists an extension to integrate SVN support into PHP. The PECL SVN package does exactly as advertised: enable SVN client commands as PHP functions.

This is invaluable if you want to display information on various repositories, or even want to create a versioning control panel. For a complex and very large webapplication this is exactly what I attempt to do: allow developers to get an overview of what revision is running on each server (test / staging / development), what the changes are in an upcoming update and, if possible, even allow developers to update a specific server to a specific revision from a single control panel.

In addition, this will then be combined with a database revisioning system to also track database updates and perform those simultaneously with code updates. The end result is a completely automated system to set a servers status to 'updating' (display a static HTML page), update the code to a specific revision, apply database structure updates, then return server status to 'normal' again. And, if anything goes wrong, all changes can easily be rolled back.

Great in theory, but in practice getting the SVN extension is a bit more troublesome. To compile the extension you need not only the latest SVN libraries (which are no longer supported) but also older SVN libraries (which are no longer available) as well as some hard to find external libraries. In short, it took me the better part of the past three hours, but the result is a fully working PHP SVN extension:

FileVersionLast updated
php_svn.dllSVN 1.6.17July 10th, 2011
libdb43.dllBerkeley DB 4.3July 28th, 2005

Compiled against PHP 5.3.6 x86 on Windows. Place the php_svn dll file in your PHP/ext folder, and the libdb43 dll file in your PHP folder if you get an error.

FragFrog out!

Jul 20, 2011 Jud

I've downloaded several dll's to make it work but still I get "unable to load dynamyc library..." on startup :(

Jul 20, 2011 Matthijs

You're sure the libraries can be found? By default they should be in your PHP/ext folder, but for example your system folder works as well.

Provided of course your PHP version matches the DLL (for 5.3.6 on an x86 machine).

Jul 21, 2011 Jud

Yeah extension_dir is correct. Maybe is about the version but... I can't find the VC6 version of PHP 5.3.6, only the VC9 which is for IIS, isn't it? I'm running Apache 2.2. Thanks :)

Jul 21, 2011 Matthijs

I am also using Apache 2.2, without problems, so in theory it should all work.

Not the first time I have seen PHP unable to load a library though, usually there is a conflict with the rest of core - I've uploaded my core here, maybe that helps :)

New comment

Your name: