Update of /cvsroot/fink/web/pdb
In directory sc8-pr-cvs17:/tmp/cvs-serv23315
Modified Files:
browse.php memcache.inc
Log Message:
turn off debug info, a few browse minor fixes
Index: memcache.inc
===================================================================
RCS file: /cvsroot/fink/web/pdb/memcache.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- memcache.inc 27 Sep 2007 23:19:41 -0000 1.2
+++ memcache.inc 28 Sep 2007 00:41:48 -0000 1.3
@@ -3,17 +3,20 @@
$memcache = new Memcache();
$memcache->connect('localhost', 11211);
+$memcache_debug = 0;
+
function cachedQuery($sql, $compress = 0) {
global $dbh;
global $memcache;
+ global $memcache_debug;
$key = md5($sql);
if ($returnVals = $memcache->get($key)) {
- echo " <!-- cached($compress) $key: $sql --> ";
+ if ($memcache_debug) echo " <!-- cached($compress) $key: $sql
--> ";
return $returnVals;
} else {
- echo " <!-- NOT cached($compress) $key: $sql --> ";
+ if ($memcache_debug) echo " <!-- NOT cached($compress) $key:
$sql --> ";
$returnVals = array();
$resultSet = mysql_query($sql, $dbh);
@@ -26,7 +29,7 @@
if ($memcache->set($key, $returnVals, $compress, 900)) {
return $returnVals;
} else {
- echo " <!-- unable to set $key($compress) --> ";
+ if ($memcache_debug) echo " <!-- unable to set
$key($compress) --> ";
return;
}
}
Index: browse.php
===================================================================
RCS file: /cvsroot/fink/web/pdb/browse.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- browse.php 27 Sep 2007 23:03:14 -0000 1.7
+++ browse.php 28 Sep 2007 00:41:48 -0000 1.8
@@ -3,7 +3,7 @@
$cvs_author = '$Author$';
$cvs_date = '$Date$';
-ini_set("memory_limit", "12M");
+ini_set("memory_limit", "16M");
function addGETParam(&$params, $param_name) {
$value = stripslashes($_GET[$param_name]);
@@ -111,11 +111,10 @@
// Distribution values
$dist_values = array();
-$q = "SELECT * FROM `distribution` WHERE active='1' ";
+$q = "SELECT `dist_id`, `description` FROM `distribution` WHERE active='1' ";
if (!$showall)
$q .= "AND visible='1' ";
$q .= "ORDER BY priority DESC";
-//$qdist = mysql_query($q, $dbh);
$qdist = cachedQuery($q);
if (!$qdist) {
die('<p class="attention"><b>Error during db query (distribution):</b>
'.mysql_error().'</p>');
@@ -140,8 +139,7 @@
// Load legal sections
$section_values = array('' => 'Any');
-$query = "SELECT * FROM sections ORDER BY name ASC";
-//$rs = mysql_query($query, $dbh);
+$query = "SELECT `name`, `description` FROM sections ORDER BY name ASC";
$rs = cachedQuery($query);
if (!$rs) {
print '<p class="attention"><b>Error during db query (sections):</b>
'.mysql_error().'</p>';
@@ -394,11 +392,10 @@
$query .= "ORDER BY p.name $sort";
$time_sql_start = microtime_float();
-//$rs = mysql_query($query, $dbh);
-#$rs = cachedQuery($query, MEMCACHE_COMPRESSED);
-$rs = cachedQuery($query);
+$rs = cachedQuery($query, MEMCACHE_COMPRESSED);
+#$rs = cachedQuery($query);
$time_sql_end = microtime_float();
-if (!$rs) {
+if (0) {
print '<p class="attention"><b>Error during db query (list packages):</b>
'.mysql_error().'</p>';
} else {
$count = count($rs);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits