"downloads", "getphp" => "downloads", "getdocs" => "download-docs", "documentation" => "docs", "mailinglists" => "mailing-lists", "mailinglist" => "mailing-lists", "changelog" => "ChangeLog-4", "gethelp" => "support", "help" => "support", "unsubscribe" => "unsub", "subscribe" => "mailing-lists", "logos" => "download-logos", # manual shortcuts "ini" => "configuration", "install" => "installation", "intro" => "introduction", "whatis" => "introduction", "whatisphp" => "introduction", "what_is_php" => "introduction", "windows" => "install.windows", "win32" => "install.windows", "globals" => "language.variables.predefined", "register_globals" => "security.registerglobals", "registerglobals" => "security.registerglobals", "gd" => "image", "tut" => "tutorial", "tut.php" => "tutorial", // BC "faq.php" => "faq", // BC "bugs.php" => "bugs", // BC "bugstats.php" => "bugstats", // BC "icap" => "mcal", // mcal is the successor of icap "README.mirror" => "mirroring", // BC "ZEND_CHANGES.txt" => "zend-engine-2.php", // BC "zend2_example.phps" => "zend-engine-2.php", // BC "manual/about-notes.php" => "manual/add-note", // BC # external shortcut aliases ;) "dochowto" => "phpdochowto", "projects.php" => "projects", // BC ); $external_redirects = array( "php4news" => "http://cvs.php.net/cvs.php/php-src/NEWS?onb=1.1247.2", "php5news" => "http://cvs.php.net/co.php/php-src/NEWS?p=1", "projects" => "http://freshmeat.net/browse/183/", "pear" => "http://pear.php.net/", "bugs" => "http://bugs.php.net/", "bugstats" => "http://bugs.php.net/bugstats.php", "phpdochowto" => "/manual/howto/index.html", "getdochowto" => "http://cvs.php.net/co.php/phpdoc/howto/howto.html.tar.gz?p=1", "rev" => "/manual/$LANG/revcheck.html.gz", "blog" => "/manual/$LANG/build.log.gz", ); // ============================================================================ // "Rewrite" the URL, if it was a shortcut if (isset($uri_aliases[$URI])) { $URI = $uri_aliases[$URI]; } // ============================================================================ // Redirect if the entered URI was a PHP page name (except the books page, // which we display in the mirror's language or the explicitly specified // language [see below]) if (!in_array($URI, array('books', 'mirror-info', 'error')) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) { mirror_redirect("/$URI.php"); } // ============================================================================ // Execute external redirect if a rule exists for the URI if (isset($external_redirects[$URI])) { $true_external = (substr($external_redirects[$URI], 0, 1) != '/'); mirror_redirect($external_redirects[$URI], $true_external); } // Temporary hack for books and mirror-info, until all the pages // will be capable of being included from anywhere if (in_array($URI, array('books', 'mirror-info'))) { include_once $_SERVER['DOCUMENT_ROOT'] . "/$URI.php"; } // ============================================================================ // Try to find the page using the preferred language as a manual page include_once "manual-lookup.inc"; $try = find_manual_page($LANG, $URI); if ($try) { @header('HTTP/1.1 200 OK'); @header('Status: 200 OK',1,200); include_once $_SERVER['DOCUMENT_ROOT'] . $try; exit; } // ============================================================================ // If no match was found till this point, the last action is to start a // search with the URI the user typed in $fallback = (myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "manual" : "quickref"); mirror_redirect( '/search.php?show=' . $fallback . '&lang=' . urlencode($LANG) . '&pattern=' . urlencode(substr($_SERVER['REQUEST_URI'], 1)) ); // A 'good looking' 404 error message page function make404() { global $_SERVER; @header('HTTP/1.1 404 Not Found'); @header('Status: 404 Not Found',1,404); header("Cache-Control: public, max-age=600"); commonHeader('404 Not Found'); echo "
The page ", htmlspecialchars($_SERVER['REQUEST_URI']), " could not be found.
\n"; commonFooter(); exit; } ?>