cvs: pearweb /public_html/error 404.php
| From: | Martin Jansen | Date: | Sat, 12 Jul 2003 10:22:41 +0000 |
| Subject: | cvs: pearweb /public_html/error 404.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-11460@lists.php.net to get a copy of this message | ||
mj Sat Jul 12 06:22:41 2003 EDT
Modified files:
/pearweb/public_html/error 404.php
Log:
* Changing the logic of the 404 redirecting stuff a bit:
From now on http://pear.php.net/Auth will directly forward
to the
package information of PEAR::Auth, while http://pear.php.net/Auth_ will
list all packages that begin with Auth_.
This allows us to use http://pear.php.net/<package> everywhere.
Index: pearweb/public_html/error/404.php
diff -u pearweb/public_html/error/404.php:1.7 pearweb/public_html/error/404.php:1.8
--- pearweb/public_html/error/404.php:1.7 Tue Apr 22 20:21:52 2003
+++ pearweb/public_html/error/404.php Sat Jul 12 06:22:41 2003
@@ -15,18 +15,29 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: 404.php,v 1.7 2003/04/23 00:21:52 tal Exp $
+ $Id: 404.php,v 1.8 2003/07/12 10:22:41 mj Exp $
*/
/**
-* On 404 error this will search for a package with the same
-* name as the requested document. Thus enabling urls such as:
-*
-* http://pear.php.net/Mail_Mime
-*/
+ * On 404 error this will search for a package with the same
+ * name as the requested document. Thus enabling urls such as:
+ *
+ * http://pear.php.net/Mail_Mime
+ */
$pkg = strtr($_SERVER['REDIRECT_URL'], "-","_");
$pinfo_url = '/package-info.php?package=';
+
+// Check strictly
+$sql = "SELECT name
+ FROM packages
+ WHERE name = ?";
+$name = $dbh->getOne($sql, array(basename($pkg)));
+if (!DB::isError($name) && !empty($name)) {
+ localRedirect($pinfo_url . $name);
+}
+
+// Check less strictly if nothing has been found previously
$sql = "SELECT p.id, p.name, p.summary
FROM packages p
WHERE name LIKE ?