r3005 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r3004‎ | r3005 | r3006 >
Date:13:59, 7 April 2004
Author:timstarling
Status:old
Tags:
Comment:
fixed notices
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/memcached-client.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageCache.php
@@ -166,7 +166,7 @@
167167 $message = false;
168168
169169 # Try the cache
170 - if ( $this->mUseCache && $this->mCache ) {
 170+ if ( $this->mUseCache && $this->mCache && array_key_exists( $title, $this->mCache ) ) {
171171 $message = $this->mCache[$title];
172172 }
173173
Index: trunk/phase3/includes/memcached-client.php
@@ -221,11 +221,11 @@
222222 */
223223 function memcached ($args)
224224 {
225 - $this->set_servers($args['servers']);
226 - $this->_debug = $args['debug'];
 225+ $this->set_servers(@$args['servers']);
 226+ $this->_debug = @$args['debug'];
227227 $this->stats = array();
228 - $this->_compress_threshold = $args['compress_threshold'];
229 - $this->_persistant = isset($args['persistant']) ? $args['persistant'] : false;
 228+ $this->_compress_threshold = @$args['compress_threshold'];
 229+ $this->_persistant = array_key_exists('persistant', $args) ? (@$args['persistant']) : false;
230230 $this->_compress_enable = true;
231231 $this->_have_zlib = function_exists("gzcompress");
232232
@@ -374,7 +374,7 @@
375375 if (!is_resource($sock))
376376 return false;
377377
378 - $this->stats['get']++;
 378+ @$this->stats['get']++;
379379
380380 $cmd = "get $key\r\n";
381381 if (!fwrite($sock, $cmd, strlen($cmd)))
@@ -813,7 +813,7 @@
814814 break;
815815 $offset += $n;
816816 $bneed -= $n;
817 - $ret[$rkey] .= $data;
 817+ @$ret[$rkey] .= $data;
818818 }
819819
820820 if ($offset != $len+2)
@@ -866,7 +866,7 @@
867867 if (!is_resource($sock))
868868 return false;
869869
870 - $this->stats[$cmd]++;
 870+ @$this->stats[$cmd]++;
871871
872872 $flags = 0;
873873

Status & tagging log