Fixed a couple of potential catchable fatal errors when memcached debugging is enabled
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 9 Apr 2008 15:22:27 +0000 (15:22 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 9 Apr 2008 15:22:27 +0000 (15:22 +0000)
includes/memcached-client.php

index 21f0c83..8adb523 100644 (file)
@@ -402,6 +402,10 @@ class memcached
       $fname = 'memcached::get';
       wfProfileIn( $fname );
 
+      if ( $this->_debug ) {
+         $this->_debugprint( "get($key)\n" );
+      }
+
       if (!$this->_active) {
         wfProfileOut( $fname );
          return false;
@@ -429,7 +433,7 @@ class memcached
 
       if ($this->_debug)
          foreach ($val as $k => $v)
-            $this->_debugprint(@sprintf("MemCache: sock %s got %s => %s\r\n", serialize($sock), $k, $v));
+            $this->_debugprint(sprintf("MemCache: sock %s got %s\n", serialize($sock), $k));
 
       wfProfileOut( $fname );
       return @$val[$key];
@@ -495,7 +499,7 @@ class memcached
 
       if ($this->_debug)
          foreach ($val as $k => $v)
-            $this->_debugprint(sprintf("MemCache: got %s => %s\r\n", $k, $v));
+            $this->_debugprint(sprintf("MemCache: got %s\n", $k));
 
       return $val;
    }