fixed notices
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 7 Apr 2004 13:59:15 +0000 (13:59 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 7 Apr 2004 13:59:15 +0000 (13:59 +0000)
includes/MessageCache.php
includes/memcached-client.php

index 807f789..0200a97 100755 (executable)
@@ -166,7 +166,7 @@ class MessageCache
                $message = false;
 
                # Try the cache
-               if ( $this->mUseCache && $this->mCache ) {
+               if ( $this->mUseCache && $this->mCache && array_key_exists( $title, $this->mCache ) ) {
                        $message = $this->mCache[$title];
                }
                
index 6a21542..217417c 100644 (file)
@@ -221,11 +221,11 @@ class memcached
     */
    function memcached ($args)
    {
-      $this->set_servers($args['servers']);
-      $this->_debug = $args['debug'];
+      $this->set_servers(@$args['servers']);
+      $this->_debug = @$args['debug'];
       $this->stats = array();
-      $this->_compress_threshold = $args['compress_threshold'];
-      $this->_persistant = isset($args['persistant']) ? $args['persistant'] : false;
+      $this->_compress_threshold = @$args['compress_threshold'];
+      $this->_persistant = array_key_exists('persistant', $args) ? (@$args['persistant']) : false;
       $this->_compress_enable = true;
       $this->_have_zlib = function_exists("gzcompress");
       
@@ -374,7 +374,7 @@ class memcached
       if (!is_resource($sock))
          return false;
          
-      $this->stats['get']++;
+      @$this->stats['get']++;
       
       $cmd = "get $key\r\n";
       if (!fwrite($sock, $cmd, strlen($cmd)))
@@ -813,7 +813,7 @@ class memcached
                   break;
                $offset += $n;
                $bneed -= $n;
-               $ret[$rkey] .= $data;
+               @$ret[$rkey] .= $data;
             }
             
             if ($offset != $len+2)
@@ -866,7 +866,7 @@ class memcached
       if (!is_resource($sock))
          return false;
          
-      $this->stats[$cmd]++;
+      @$this->stats[$cmd]++;
       
       $flags = 0;