}
if ($this->getOption('v')) {
- $this->out('Cache Driver Name: ' . (string)$this->cache);
+ $this->out('Cache Driver Name: ' . $this->cache->getName());
$this->out('Cache Driver Class: ' . get_class($this->cache));
}
return true;
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_APCU;
}
}
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_ARRAY;
}
const MINUTE = 60;
const INFINITE = 0;
- /**
- * Force each Cache implementation to define the ToString method
- *
- * @return string
- */
- abstract function __toString();
-
/**
* @var string The hostname
*/
}
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_DATABASE;
}
* @return bool
*/
public function clear($outdated = true);
+
+ /**
+ * Returns the name of the current cache
+ *
+ * @return string
+ */
+ public function getName();
}
return $this->memcache->add($cachekey, serialize($value), MEMCACHE_COMPRESSED, $ttl);
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_MEMCACHE;
}
return $this->memcached->add($cachekey, $value, $ttl);
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_MEMCACHED;
}
}
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function GetName()
{
- return (string)$this->cache . ' (with profiler)';
+ return $this->cache->getName() . ' (with profiler)';
}
}
return false;
}
- public function __toString()
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
{
return self::TYPE_REDIS;
}