Renamed __toString() to getName()
This commit is contained in:
parent
d2211bd6dd
commit
3834d5e129
|
@ -87,7 +87,7 @@ HELP;
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,10 @@ class APCuCache extends Cache implements IMemoryCache
|
|||
return true;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_APCU;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,10 @@ class ArrayCache extends Cache implements IMemoryCache
|
|||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_ARRAY;
|
||||
}
|
||||
|
|
|
@ -28,13 +28,6 @@ abstract class Cache implements ICache
|
|||
const MINUTE = 60;
|
||||
const INFINITE = 0;
|
||||
|
||||
/**
|
||||
* Force each Cache implementation to define the ToString method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract function __toString();
|
||||
|
||||
/**
|
||||
* @var string The hostname
|
||||
*/
|
||||
|
|
|
@ -110,7 +110,10 @@ class DatabaseCache extends Cache implements ICache
|
|||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_DATABASE;
|
||||
}
|
||||
|
|
|
@ -54,4 +54,11 @@ interface ICache
|
|||
* @return bool
|
||||
*/
|
||||
public function clear($outdated = true);
|
||||
|
||||
/**
|
||||
* Returns the name of the current cache
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName();
|
||||
}
|
||||
|
|
|
@ -148,7 +148,10 @@ class MemcacheCache extends Cache implements IMemoryCache
|
|||
return $this->memcache->add($cachekey, serialize($value), MEMCACHE_COMPRESSED, $ttl);
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_MEMCACHE;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,10 @@ class MemcachedCache extends Cache implements IMemoryCache
|
|||
return $this->memcached->add($cachekey, $value, $ttl);
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_MEMCACHED;
|
||||
}
|
||||
|
|
|
@ -152,8 +152,11 @@ class ProfilerCache implements ICache, IMemoryCache
|
|||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function GetName()
|
||||
{
|
||||
return (string)$this->cache . ' (with profiler)';
|
||||
return $this->cache->getName() . ' (with profiler)';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,10 @@ class RedisCache extends Cache implements IMemoryCache
|
|||
return false;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return self::TYPE_REDIS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue