mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Improve performance of class existence checks
This commit is contained in:
parent
ba9adb2f6e
commit
6d324633a5
3 changed files with 7 additions and 7 deletions
10
common/framework/drivers/cache/memcached.php
vendored
10
common/framework/drivers/cache/memcached.php
vendored
|
|
@ -26,12 +26,12 @@ class Memcached implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
*/
|
||||
public function __construct(array $config)
|
||||
{
|
||||
if (class_exists('\\Memcached'))
|
||||
if (class_exists('\\Memcached', false))
|
||||
{
|
||||
$this->_conn = new \Memcached;
|
||||
$this->_ext = 'Memcached';
|
||||
}
|
||||
elseif (class_exists('\\Memcache'))
|
||||
elseif (class_exists('\\Memcache', false))
|
||||
{
|
||||
$this->_conn = new \Memcache;
|
||||
$this->_ext = 'Memcache';
|
||||
|
|
@ -60,7 +60,7 @@ class Memcached implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return class_exists('\\Memcached') || class_exists('\\Memcache');
|
||||
return class_exists('\\Memcached', false) || class_exists('\\Memcache', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -73,12 +73,12 @@ class Memcached implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
*/
|
||||
public static function validateSettings($config)
|
||||
{
|
||||
if (class_exists('\\Memcached'))
|
||||
if (class_exists('\\Memcached', false))
|
||||
{
|
||||
$conn = new \Memcached;
|
||||
$ext = 'Memcached';
|
||||
}
|
||||
elseif (class_exists('\\Memcache'))
|
||||
elseif (class_exists('\\Memcache', false))
|
||||
{
|
||||
$conn = new \Memcache;
|
||||
$ext = 'Memcache';
|
||||
|
|
|
|||
2
common/framework/drivers/cache/redis.php
vendored
2
common/framework/drivers/cache/redis.php
vendored
|
|
@ -62,7 +62,7 @@ class Redis implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return class_exists('\\Redis');
|
||||
return class_exists('\\Redis', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
common/framework/drivers/cache/sqlite.php
vendored
2
common/framework/drivers/cache/sqlite.php
vendored
|
|
@ -72,7 +72,7 @@ class SQLite implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
*/
|
||||
public function isSupported()
|
||||
{
|
||||
return class_exists('\\SQLite3');
|
||||
return class_exists('\\SQLite3', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue