I guess I'm going to have to have a post-update hook that watches for any new virtual host files, sym-links them into the location where Apache can see them and gracefully restarts Apache. But looking at the subversion manual there doesn't actually appear to be such a thing as a post-update hook is that right? It's a little bizarre and annoying.
I'm using virtual hosts for all site specific configuration, I've disabled .htaccess and so some of them can be 50, 60 lines in length. A lot of the settings are server specific as well so I was thinking I could use PHP as a template language to have the final versions get dynamically generated by that post-update hook. For example:
Code: Select all
$data = array(
'foo' => array(
'htDocs' => '/web/sites/foo',
'dbUser' => 'bob',
'dbPass' => 'x',
),
'bar' => array(
'htDocs' => '/var/htdocs/foo',
'dbUser' => 'jim',
'dbPass' => 'x',
)
);
$serverName = php_uname('n');
if (!isset($data[$serverName])) {
trigger_error('Virtual Host settings not defined for this server,
falling back to default');
$data = $data['foo'];
} else {
$data = $data[$serverName];
}
?>
DocumentRoot <?php echo $htDocs ?>
<Directory <?php echo $htDocs ?>>
Order Allow,Deny
Allow from all
</Directory>
...Does anyone know anything about Ping?
Apparently there is also a database you can use that integrates directly with Apache but that doesn't really appeal because I don't want to introduce any more systems to my configuration and besides data in a database is harder to get to than just in the file system.
Whilst we're at it what other things do you do with hooks? I've seen recently that you can prevent merges and commits with failing unit tests, does anyone do that?