- added language support (still needs some tweaking, and swedish language file needs correct locale settings)

- removed timer.exc.php and put the needed intializer directly in view.php to get a more accurate reading from $timer->end()
- updated .htaccess settings to they for once work 100% as they should, and added httpd_dlist.conf to respository to keep track of any changes/updates needed to the .htaccess file or apache config file (depending how you implement dList)

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@11 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-04-01 23:24:32 +00:00
parent 05fc88b1d9
commit a8fe6d5a8c
14 changed files with 247 additions and 82 deletions

View File

@@ -11,37 +11,40 @@
// Server configuration
$config['index_files'] = array('index.html', 'index.php', 'index.htm');
$config['index_files'] = array('index.html', 'index.php');
$config['default_scheme'] = 'http';
// process requested path
if ( stristr($_SERVER['REQUEST_URI'], '?') !== false ) {
$dir_url = explode('?', $_SERVER['REQUEST_URI']);
$query_string = $dir_url[1];
$dir_url = urldecode($dir_url[0]);
if ( preg_match("/^(.*?)\?(.*)$/i", $_SERVER['REQUEST_URI'], $dir_url) ) {
$query_string = $dir_url[2];
$dir_url = urldecode($dir_url[1]);
} else {
$query_string = '';
$dir_url = urldecode($_SERVER['REQUEST_URI']);
}
// path lookup
$dir_path = apache_lookup_uri($dir_url);
$dir_path = ( is_array($dir_path) ) ? $dir_path['filename'] : $dir_path->filename ;
if(!preg_match("/\/$/", $dir_path)) $dir_path .= '/';
if(!preg_match("/\/$/", $dir_url)) $redirect = '/';
// check for index files and redirect if found
if ( empty($redirect) ) {
// path lookup
$dir_path = apache_lookup_uri($dir_url);
$dir_path = ( is_array($dir_path) ) ? $dir_path['filename'] : $dir_path->filename ;
if(!preg_match("/\/$/", $dir_path)) $dir_path .= '/';
// check for index files and redirect if found
foreach($config['index_files'] as $what) {
if ( file_exists($dir_path.$what) ) {
$redirect = basename($what);
break;
}
}
}
if ( !empty($redirect) ) {
if(!empty($_SERVER['SCRIPT_URI'])) {
$scheme = parse_url($_SERVER['SCRIPT_URI']);