cvs: phpweb / results.php ws.php
| From: | Rasmus Lerdorf | Date: | Sun, 05 Mar 2006 07:16:20 +0000 |
| Subject: | cvs: phpweb / results.php ws.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-30810@lists.php.net to get a copy of this message | ||
rasmus Sun Mar 5 07:16:20 2006 UTC
Modified files:
/phpweb results.php ws.php
Log:
Let's keep track of the mirror the searches are coming from as well
http://cvs.php.net/viewcvs.cgi/phpweb/results.php?r1=1.18&r2=1.19&diff_format=u
Index: phpweb/results.php
diff -u phpweb/results.php:1.18 phpweb/results.php:1.19
--- phpweb/results.php:1.18 Fri Mar 3 07:47:52 2006
+++ phpweb/results.php Sun Mar 5 07:16:20 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: results.php,v 1.18 2006/03/03 07:47:52 rasmus Exp $
+// $Id: results.php,v 1.19 2006/03/05 07:16:20 rasmus Exp $
$_SERVER['BASE_PAGE'] = 'results.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
#include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
@@ -22,7 +22,7 @@
$valid_profiles = array('all', 'local', 'manual', 'news',
'bugs', 'pear', 'pecl', 'talks');
$scope = in_array($_GET['p'], $valid_profiles) ? $_GET['p'] : 'all';
$srch_host = "www.php.net";
-$srch_rqst =
"/ws.php?profile=$scope&q=$q&lang=$l&results=$per_page&start=$s";
+$srch_rqst =
"/ws.php?profile=$scope&q=$q&lang=$l&results=$per_page&start=$s&mirror=".trim(substr($MYSITE,7),'/');
$url = "http://".$srch_host.$srch_rqst;
if(function_exists('file_get_contents') && ini_get('allow_url_fopen'))
{
http://cvs.php.net/viewcvs.cgi/phpweb/ws.php?r1=1.6&r2=1.7&diff_format=u
Index: phpweb/ws.php
diff -u phpweb/ws.php:1.6 phpweb/ws.php:1.7
--- phpweb/ws.php:1.6 Tue Feb 28 12:05:29 2006
+++ phpweb/ws.php Sun Mar 5 07:16:20 2006
@@ -8,6 +8,7 @@
$r = isset($_REQUEST['results']) ? (int)$_REQUEST['results'] : 10;
$s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 1;
$l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang']) :
'en';
+$m = isset($_REQUEST['mirror']) ? htmlspecialchars($_REQUEST['mirror']) :
'';
$sites = array( 'all'=>'php.net',
'local'=>'www.php.net',
'manual'=>'www.php.net',
@@ -34,8 +35,8 @@
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
try {
- $stmt = $dbh->prepare("INSERT INTO log (query,profile) VALUES (:query,:profile)");
- $stmt->execute(array(':query'=>$raw,':profile'=>$scope));
+ $stmt = $dbh->prepare("INSERT INTO log (query,profile,mirror) VALUES
(:query,:profile,:mirror)");
+
$stmt->execute(array(':query'=>$raw,':profile'=>$scope,':mirror'=>$m));
} catch (PDOException $e) {
}