cvs: phpweb /error index.php

From: Date: Tue, 09 Jul 2002 08:31:31 +0000
Subject: cvs: phpweb /error index.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-11218@lists.php.net to get a copy of this message
goba Tue Jul 9 04:31:31 2002 EDT Modified files: /phpweb/error index.php Log: Organize external shortcuts in a more general fashion. Group them before the language dependent shortcut's section, because they are not langauge dependent. Hope this makes the code a bit more logical. Index: phpweb/error/index.php diff -u phpweb/error/index.php:1.66 phpweb/error/index.php:1.67 --- phpweb/error/index.php:1.66 Mon Jul 8 16:00:09 2002 +++ phpweb/error/index.php Tue Jul 9 04:31:31 2002 @@ -101,7 +101,7 @@ } // ============================================================================ -// Define shortcuts for PHP and manual pages +// Define shortcuts for PHP files, manual pages and external redirects $uri_aliases = array ( # PHP page shortcuts @@ -125,7 +125,15 @@ "windows" => "install.windows", "win32" => "install.windows", "globals" => "security.registerglobals", + + # external manual shortcut aliases ;) + "dochowto" => "phpdochowto" + +); +$external_redirects = array( + "phpdochowto" => "http://cvs.php.net/co.php/phpdoc/howto/howto.html.tar.gz", + "php4news" => "http://cvs.php.net/co.php/php4/NEWS?p=1" ); // ============================================================================ @@ -142,6 +150,13 @@ } // ============================================================================ +// Execute external redirect if a rule exists for the URI +if (isset($external_redirects[strtolower($uri)])) { + header("Location: " . $external_redirects[strtolower($uri)]); + exit; +} + +// ============================================================================ // Try to find the URI as a manual entry require "manual-lookup.inc"; if (strchr($uri,'/')) { @@ -150,7 +165,7 @@ list($lang,$function) = explode('/',$uri,2); $function = strtolower($function); - $lang = strtolower($lang); + if ($lang != 'pt_BR') { $lang = strtolower($lang); } // Transform function name, so it can be a shortcut if (isset($uri_aliases[$function])) { @@ -162,22 +177,12 @@ } // ============================================================================ -// Quick access to revcheck output, build logs and howto for manual writers +// Quick access to revcheck output and build logs for various languages if ($function == "rev") { header("Location: http://$SERVER_NAME/manual/$lang/revcheck.html.gz"); exit; } elseif ($function == "blog") { header("Location: http://$SERVER_NAME/manual/$lang/build.log.gz"); - exit; -} elseif (in_array($function, array("dochowto", "phpdochowto"))) { - header("Location: http://cvs.php.net/co.php/phpdoc/howto/howto.html.tar.gz"); - exit; -} - -// ============================================================================ -// Link to PHP4 NEWS file -elseif ($function == "php4news") { - header("Location: http://cvs.php.net/co.php/php4/NEWS?p=1"); exit; }

« previous php.mirrors (#11218) next »