Putting this code into a page will let it update the site from a repository:
<pre>
<?php system( 'svn up sites/default/...'); ?>
</pre><h1>Done!</h1>
Note that apache must have write permission for the whole directory tree.
I tried the following but couldn't get it to work (probably not in my version of PHP):
svn_checkout('http://myserver.com/svn/demo', '/var/www/html/demo/temp');
If the repository requires a password for update, the following can be done:
-
svn up --config-dir /var/www/html --username sites/default/...
#(will ask for password)
This will create an auth directory in /var/www/html
-
chown apache -R /var/www/html/auth
- Now the Drupal page can simply contain:
<pre><?php system('svn up --config-dir /var/www/html sites/default/...'); ?></pre>
Creating a new Drupal site
- dget create dirname dbname
- #visit site and install Drupal
- cd [dirname]/sites
- mkdir -p default/themes
- chown [username]:[username] -R default
- chown apache -R default/files
- chmod 755 -R default/files
- svn import --username [name] default http://.../drupal
Or, to import in place (logged in as user), use:
svn=http://...
usr="--username [name]"
- svn mkdir $usr $svn/drupal -m "make drupal dir"
- svn checkout $svn/drupal default
- svn add default/*
- svn commit default -m "initial upload from website"