cvs: phpweb /include index.php manual-lookup.inc

From: Date: Sun, 08 Jul 2001 11:30:25 +0000
Subject: cvs: phpweb /include index.php manual-lookup.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-5356@lists.php.net to get a copy of this message
goba Sun Jul 8 07:30:25 2001 EDT Modified files: /phpweb/include index.php manual-lookup.inc Log: More general "include" redirection, added comment Index: phpweb/include/index.php diff -u phpweb/include/index.php:1.6 phpweb/include/index.php:1.7 --- phpweb/include/index.php:1.6 Sat Jul 7 06:33:42 2001 +++ phpweb/include/index.php Sun Jul 8 07:30:23 2001 @@ -1,11 +1,16 @@ <?php +// This page tries to find the manual page for "include" +// because people can access that page by using +// http://www.php.net/include as a REQUEST_URI + require_once 'prepend.inc'; +require_once 'manual-lookup.inc'; + +$file = find_manual_page(default_language(), "include"); -$lang = default_language(); -if (is_dir($lang)) { - header("Location: /manual/$lang/function.include.php"); -} -header("Location: /manual/en/function.include.php"); +if ($file) { + header("Location: $file"); +} else { header("Location: /"); } -?> +?> \ No newline at end of file Index: phpweb/include/manual-lookup.inc diff -u phpweb/include/manual-lookup.inc:1.5 phpweb/include/manual-lookup.inc:1.6 --- phpweb/include/manual-lookup.inc:1.5 Sun Jul 1 05:59:41 2001 +++ phpweb/include/manual-lookup.inc Sun Jul 8 07:30:23 2001 @@ -15,17 +15,17 @@ $nosp = ereg_replace(" ", "", $func); if ($nosp != $func) { - $try = "/manual/${cc}/${prefix}${nosp}.php"; + $try = "/manual/${cc}/${prefix}${nosp}.php"; if (file_exists("$DOCUMENT_ROOT$try")) return $try; } $dasp = ereg_replace(" ", "-", $func); if ($dasp != $func) { - $try = "/manual/${cc}/${prefix}${dasp}.php"; + $try = "/manual/${cc}/${prefix}${dasp}.php"; if (file_exists("$DOCUMENT_ROOT$try")) return $try; } $noul = ereg_replace("-", "", $func); if ($noul != $func) { - $try = "/manual/${cc}/${prefix}${noul}.php"; + $try = "/manual/${cc}/${prefix}${noul}.php"; if (file_exists("$DOCUMENT_ROOT$try")) return $try; } return ""; @@ -39,8 +39,8 @@ } if ($lang != "en") { while (list($t,$section) = each($sections)) { - $try = tryprefix("en", $function, $section); - if ($try) return $try; + $try = tryprefix("en", $function, $section); + if ($try) return $try; } } return "";

« previous php.mirrors (#5356) next »