* $val = $mc->get('key');
*
* @author Ryan T. Dean <rtdean@cytherianage.net>
- * @package memcached-client
* @version 0.1.2
*/
* memcached client class implemented using (p)fsockopen()
*
* @author Ryan T. Dean <rtdean@cytherianage.net>
- * @addtogroup Cache
+ * @ingroup Cache
*/
class memcached
{
/**
* At how many bytes should we compress?
*
- * @var integer
+ * @var integer
* @access private
*/
var $_compress_threshold;
/**
* Total # of bit buckets we have
*
- * @var integer
+ * @var integer
* @access private
*/
var $_bucketcount;
/**
* # of total servers we have
*
- * @var integer
+ * @var integer
* @access private
*/
var $_active;
$fname = 'memcached::get';
wfProfileIn( $fname );
+ if ( $this->_debug ) {
+ $this->_debugprint( "get($key)\n" );
+ }
+
if (!$this->_active) {
wfProfileOut( $fname );
return false;
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];
$this->stats['get_multi']++;
$sock_keys = array();
-
+
foreach ($keys as $key)
{
$sock = $this->get_sock($key);
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;
}
$realkey = is_array($key) ? $key[1] : $key;
for ($tries = 0; $tries<20; $tries++)
{
+ // temp logging for strange bug
+ if( !isset($this->_buckets[$hv % $this->_bucketcount]) ) {
+ wfDebugLog( "memcached", "Invalid bucket hash '$hv' from key '$realkey' given!" );
+ continue;
+ }
$host = $this->_buckets[$hv % $this->_bucketcount];
$sock = $this->sock_to_host($host);
if (is_resource($sock)) {
if ($this->_debug)
{
- if ($flags & memcached::COMPRESSED)
- $val = 'compressed data';
- $this->_debugprint(sprintf("MemCache: %s %s => %s (%s)\n", $cmd, $key, $val, $line));
+ $this->_debugprint(sprintf("%s %s (%s)\n", $cmd, $key, $line));
}
if ($line == "STORED")
return true;
// vim: sts=3 sw=3 et
// }}}
-