A few days ago hcgtv wrote about snif. I immediately started playing with it and I really like it :). I'm using it now for both my testcases directory as my (new) releases directory, in which i will keep development versions of plugins and other stuff.

Snif can display subfolders, but it uses a parameter in the url to link to them, so if you want to add sniff to a subfolder too, you have to copy a simple index.php file in every subdirectory. Because i don't like having to add a file in every subdirectory i started playing with a RewriteRule in the .htaccess-file. I added the following:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}       -d
RewriteRule (.*)                      /releases/index.php?path=$1  [QSA,L]

Also i set up snif to link directly to subdirs:

$directDirectoryLinks = true;

It almost works, but links to file now contain the subfoldername twice... The code in the index.php-files for the subfolders will cetainly help to solve this issue :)

UPDATE: The solution :)

Around line 350 (somewhere in the config-section) add:

 * Set the base url, used in the &lt;base&gt; tag. This should only be changed when
 * you want to use RewriteRules or similar tricks.
$baseURL = 'http://'.$snifServer.'/releases/';

(ofcourse you should change the value of $baseURL according to the url on your server)

Then add around line 1949 (somewhere in the <head> of the generated html):

<base href="<?php echo $baseURL; ?>" />



Miguel on 2005-06-16 16:08 reply

Instead of using '

Instead of using '<base href=' you could use $baseURL in some places to correct the relative url to a absolute path.

This is a trickier but cleaner method.

Comment Atom Feed