cvs: phpweb /error index.php
| From: | Rasmus Lerdorf | Date: | Sat, 16 Dec 2000 16:13:47 +0000 |
| Subject: | cvs: phpweb /error index.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-3121@lists.php.net to get a copy of this message | ||
rasmus Sat Dec 16 08:13:47 2000 EDT
Modified files:
/phpweb/error index.php
Log:
Support languages in the quick-access hack. ie. www.php.net/de/strlen
Index: phpweb/error/index.php
diff -u phpweb/error/index.php:1.6 phpweb/error/index.php:1.7
--- phpweb/error/index.php:1.6 Fri Oct 6 14:02:45 2000
+++ phpweb/error/index.php Sat Dec 16 08:13:47 2000
@@ -18,35 +18,43 @@
$uri = strchr($uri,'/');
$uri = substr($uri,1);
+if(strchr($uri,'/')) {
+ list($lang,$function) = explode('/',$uri,2);
+ $lang .= '/';
+ $function = strtolower($function);
+ $lang = strtolower($lang);
+} else $function = strtolower($uri);
+
+if($lang=='en') $lang = '';
+
$try_files = array();
-$function = strtolower($uri);
-function tryprefix($func, $prefix) {
+function tryprefix($lang, $func, $prefix) {
global $try_files;
$func = ereg_replace("_","-",$func);
$func = ereg_replace('\(.*\)',"-",$func);
- $try_files[] = "/manual/${prefix}${func}.php";
+ $try_files[] = "/manual/${lang}${prefix}${func}.php";
$nosp = ereg_replace(" ", "", $func);
if ($nosp != $func) {
- $try_files[] = "/manual/${prefix}${nosp}.php";
+ $try_files[] = "/manual/${lang}${prefix}${nosp}.php";
}
$dasp = ereg_replace(" ", "-", $func);
if ($dasp != $func) {
- $try_files[] = "/manual/${prefix}${dasp}.php";
+ $try_files[] = "/manual/${lang}${prefix}${dasp}.php";
}
$noul = ereg_replace("-", "", $func);
if ($noul != $func) {
- $try_files[] = "/manual/${prefix}${noul}.php";
+ $try_files[] = "/manual/${lang}${prefix}${noul}.php";
}
}
-tryprefix($function, "function.");
-tryprefix($function, "class.");
-tryprefix($function, "ref.");
-tryprefix($function, "feature-");
-tryprefix($function, "construct.");
-tryprefix($function, "control-structures.");
+tryprefix($lang,$function, "function.");
+tryprefix($lang,$function, "class.");
+tryprefix($lang,$function, "ref.");
+tryprefix($lang,$function, "feature-");
+tryprefix($lang,$function, "construct.");
+tryprefix($lang,$function, "control-structures.");
reset($try_files);
while (list($dummy, $file) = each($try_files)) {