[Cache] Fix trigger_error

This commit is contained in:
Jérémy Derussé 2017-01-29 19:12:58 +01:00 committed by Nicolas Grekas
parent bcf8b68be9
commit ca385510f0

View File

@ -73,11 +73,11 @@ trait MemcachedTrait
} elseif (!is_array($servers)) {
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument, %s given.', gettype($servers)));
}
if (!static::isSupported()) {
throw new CacheException('Memcached >= 2.2.0 is required');
}
set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); });
try {
if (!static::isSupported()) {
throw new trigger_error('Memcached >= 2.2.0 is required');
}
$options += static::$defaultClientOptions;
$client = new \Memcached($options['persistent_id']);
$username = $options['username'];