svn: /web/php/trunk/ error.php manual-lookup.php quickref.php search.php ws.php
| From: | Rasmus Lerdorf | Date: | Sat, 16 Jul 2011 06:51:35 +0000 |
| Subject: | svn: /web/php/trunk/ error.php manual-lookup.php quickref.php search.php ws.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11653@lists.php.net to get a copy of this message | ||
rasmus Sat, 16 Jul 2011 06:51:35 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313275
Log:
Distinguish between 404s and explicit searches and don't log mirrortest
Changed paths:
U web/php/trunk/error.php
U web/php/trunk/manual-lookup.php
U web/php/trunk/quickref.php
U web/php/trunk/search.php
U web/php/trunk/ws.php
Modified: web/php/trunk/error.php
===================================================================
--- web/php/trunk/error.php 2011-07-16 06:02:53 UTC (rev 313274)
+++ web/php/trunk/error.php 2011-07-16 06:51:35 UTC (rev 313275)
@@ -495,7 +495,7 @@
// ============================================================================
// 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");
+$fallback = (myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "404manual" :
"404quickref");
mirror_redirect(
'/search.php?show=' . $fallback . '&lang=' . urlencode($LANG) .
'&pattern=' . urlencode(substr($_SERVER['REQUEST_URI'], 1))
Modified: web/php/trunk/manual-lookup.php
===================================================================
--- web/php/trunk/manual-lookup.php 2011-07-16 06:02:53 UTC (rev 313274)
+++ web/php/trunk/manual-lookup.php 2011-07-16 06:51:35 UTC (rev 313275)
@@ -16,6 +16,10 @@
$function = htmlspecialchars($_GET['function'], ENT_QUOTES, 'UTF-8');
}
+if(!empty($_GET['scope'])) {
+ $scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
+} else $scope = '';
+
// Prepare data for search
if ($function) {
if ($MQ) {
Modified: web/php/trunk/quickref.php
===================================================================
--- web/php/trunk/quickref.php 2011-07-16 06:02:53 UTC (rev 313274)
+++ web/php/trunk/quickref.php 2011-07-16 06:51:35 UTC (rev 313275)
@@ -1,5 +1,4 @@
<?php
-
// $Id$
/*
@@ -30,6 +29,10 @@
$notfound = '';
}
+if (!isset($scope)) {
+ $scope = '';
+}
+
// Print out the table of found (or all) functions. The HTML comments are
// needed to support MyCroft search (Mozilla browser family and Sherlock for MacOSX)
function quickref_table($functions, $sort = true)
@@ -149,7 +152,7 @@
<?php
if(strlen($notfound) > 2):
-$srch_rqst =
"/ws.php?profile=local&q=".urlencode($notfound)."&lang=$LANG&results=5&start=0&mirror=".trim(substr($MYSITE,7),'/');
+$srch_rqst =
"/ws.php?profile=$scope&q=".urlencode($notfound)."&lang=$LANG&results=5&start=0&mirror=".trim(substr($MYSITE,7),'/');
$url = "http://www.php.net".$srch_rqst;
$data = fetch_contents($url);
if(!is_array($data)) {
Modified: web/php/trunk/search.php
===================================================================
--- web/php/trunk/search.php 2011-07-16 06:02:53 UTC (rev 313274)
+++ web/php/trunk/search.php 2011-07-16 06:51:35 UTC (rev 313275)
@@ -49,8 +49,9 @@
switch ($_FORM['show']) {
case "quickref" :
+ case "404quickref" :
$langparam = (isset($EXPL_LANG) ? "&lang=$EXPL_LANG" : "");
- mirror_redirect("/manual-lookup.php?pattern={$ucp}{$langparam}");
+
mirror_redirect("/manual-lookup.php?pattern={$ucp}{$langparam}&scope={$_FORM['show']}");
case "maillist" :
mirror_redirect("{$ml_url}l=php-general&s={$ucp}");
@@ -76,7 +77,8 @@
}
case "manual":
- mirror_redirect($MYSITE . "results.php?q={$ucp}&p=manual&l=$LANG");
+ case "404manual":
+ mirror_redirect($MYSITE .
"results.php?q={$ucp}&p={$_FORM['show']}&l=$LANG");
break;
case "news_archive":
Modified: web/php/trunk/ws.php
===================================================================
--- web/php/trunk/ws.php 2011-07-16 06:02:53 UTC (rev 313274)
+++ web/php/trunk/ws.php 2011-07-16 06:51:35 UTC (rev 313275)
@@ -12,8 +12,10 @@
$m = isset($_REQUEST['mirror']) ? htmlspecialchars($_REQUEST['mirror'],
ENT_QUOTES) : '';
$sites = array( 'all'=>'php.net',
'local'=>'www.php.net',
- '404'=>'www.php.net',
+ 'quickref'=>'www.php.net',
+ '404quickref'=>'www.php.net',
'manual'=>"www.php.net/manual/$l",
+ '404manual'=>"www.php.net/manual/$l",
'news'=>'news.php.net',
'bugs'=>'bugs.php.net',
'pear'=>'pear.php.net',
@@ -69,6 +71,7 @@
return serialize($massaged);
}
+if($scope!='mirrortest'):
$dbh = new PDO('mysql:host=localhost;dbname=ws', $conf['db_user'],
$conf['db_pw'], array(PDO::ATTR_PERSISTENT => true,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@@ -78,4 +81,5 @@
} catch (PDOException $e) {
}
+endif;
?>