Copyright 2008 Yuri Timofeev

In Russian


A set of scripts named "svnexport.php" is intended to update the Web site from the Subversion repository by using "svn export [options]" command.

You can work through a Web interface or from the command line.

Distinctive feature

Switching working versions of the website occurs almost instantaneously through symlink. I.e. excludes a situation where in the process of updating (export or checkout) part of files already updated, and some part old version.

How it works

Attention! The script svnexport.php should be placed outside catalog the Web site.

Attention! Catalog/section of the website (or DocumentRoot for the entire website), which will be updated through the "svn export" must be a symlink!

Approximate scheme directories on a website:

[some dir]
 +--site_dir --(symlink)--> site_dir.1
 +--svnctrl (web interface for svnexport)

The scheme of a works through a Web interface:

  1. User authorization (names and passwords are set up in the configuration file)
  2. Enter in web form the revision parameter (optional). See "svn help export" for details
  3. After clicking "Run svn export" button in the web form on the disk creates a file FLAG with data for export
  4. svnexport.php script runs in cron, for example, every 10-15 minutes and monitors the presence of a file FLAG
  5. If the FLAG file exists, then read the data for export, mainly is revision value.
  6. Further deleted all the files, subdirectories from
    off-site catalog site_dir.2.
    See scheme of directories on the webserver.
  7. Do svn export in site_dir.2;
  8. If all successful, the symlink

    site_dir --> site_dir.1

    is replaced by

    site_dir --> site_dir.2

    NOTE. The next launch svnexport.php will be cleaned a off-site directory site_dir.1.

    svn export will be into site_dir.1 and symlink site_dir will reassign from site_dir.2 to site_dir.1.

  9. After the successful completion of works, called a user script HOOKAFTER.
    In the script HOOKAFTER can be, such as setting rights for files and directories.
  10. The user(s) receives an email detailed report.

The scheme of a works through a command line:

System requirements

PHP4 and later, http server, access to the server file system and crond.


Copyright 2008 Yuri Timofeev

Svnexport.php is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Svnexport.php is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANT ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see


Project page on

Receive the newest version from Source Forge Subversion Server:

svn co  <your dir>


Other methods: Logo

tim 2008-09-27