RE: phpweb / manual-lookup.php
| From: | Spyros Ioakim | Date: | Fri, 08 Aug 2003 13:56:39 +0000 |
| Subject: | RE: phpweb / manual-lookup.php | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-20002@lists.php.net to get a copy of this message | ||
I don't know if it's the changes you made but I get the following...
Warning: opendir(/home/httpd/phpweb/manual/el): failed to open dir: No
such file or directory in /home/httpd/phpweb/quickref.php on line 51
Warning: readdir(): supplied argument is not a valid Directory resource
in /home/httpd/phpweb/quickref.php on line 56
Warning: closedir(): supplied argument is not a valid Directory resource
in /home/httpd/phpweb/quickref.php on line 73
On my mirror (gr2.php.net) I have setup up SetEnv MIRROR_LANGUAGE "en".
My accept language in the browser is el and I tried it with IE6.
Also downloads don't work for me.
E.g. http://gr2.php.net/get/php-4.3.0-to-4.3.1.patch.gz/from/a/mirror
Gives a page not found error.
I just checked both with mozilla and accept language en and they both
work ok.
Apparently something has to do with the way the accept language is
treated...
Spyros
-----Original Message-----
From: Gabor Hojtsy [mailto:goba@php.net]
Sent: Friday, August 08, 2003 4:46 PM
To: php-mirrors@lists.php.net
Subject: cvs: phpweb / manual-lookup.php
goba Fri Aug 8 09:46:28 2003 EDT
Modified files:
/phpweb manual-lookup.php
Log:
Manual lookup remake:
- use new type of includes
- add base page functionality
- use $_GET vars instead of register_globals
- use existing information ($MQ, $LANG)
- use mirror_redirect() for redirection
Index: phpweb/manual-lookup.php
diff -u phpweb/manual-lookup.php:1.21 phpweb/manual-lookup.php:1.22
--- phpweb/manual-lookup.php:1.21 Thu May 22 13:31:44 2003
+++ phpweb/manual-lookup.php Fri Aug 8 09:46:28 2003
@@ -1,25 +1,27 @@
-<?php // -*- C++ -*-
-
-require_once 'prepend.inc';
-require_once 'loadavg.inc';
-require_once 'manual-lookup.inc';
-
-if (!$function && $pattern) $function = $pattern;
-
-if (get_magic_quotes_gpc()) $function = stripslashes($function);
-
-$function = strtolower($function);
-
-if (empty($lang)) $lang = default_language();
-
-$file = find_manual_page($lang, $function);
+<?php
+// $Id: manual-lookup.php,v 1.22 2003/08/08 13:46:28 goba Exp $
+$_SERVER['BASE_PAGE'] = 'manual-lookup.php'; include_once
+$_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; include_once
+$_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; include_once
+$_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc';
+
+// BC code, so patter and function can equaly be used as
+// parameters to specify the function name
+if (empty($_GET['function']) && !empty($_GET['pattern'])) {
+ $_GET['function'] = $_GET['pattern'];
+}
-if ($file) {
- header("Location: $file");
- exit;
+// Prepare data for search
+if ($MQ) { $_GET['function'] = stripslashes($_GET['function']); }
+$_GET['function'] = strtolower($_GET['function']);
+
+// Try to find appropriate manual page
+if ($file = find_manual_page($LANG, $_GET['function'])) {
+ mirror_redirect($file);
}
-$notfound = $function;
-include 'quickref.php';
+// Fall back to a quick reference search
+$notfound = $_GET['function'];
+include_once $_SERVER['DOCUMENT_ROOT'] . '/quickref.php';
?>