minor #21454 [Cache] Fix trigger_error (jderusse)
This PR was squashed before being merged into the 3.3-dev branch (closes #21454).
Discussion
----------
[Cache] Fix trigger_error
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | NA
Commits
-------
ca38551
[Cache] Fix trigger_error
This commit is contained in:
commit
6791124f93
@ -73,11 +73,11 @@ trait MemcachedTrait
|
|||||||
} elseif (!is_array($servers)) {
|
} elseif (!is_array($servers)) {
|
||||||
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument, %s given.', gettype($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); });
|
set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); });
|
||||||
try {
|
try {
|
||||||
if (!static::isSupported()) {
|
|
||||||
throw new trigger_error('Memcached >= 2.2.0 is required');
|
|
||||||
}
|
|
||||||
$options += static::$defaultClientOptions;
|
$options += static::$defaultClientOptions;
|
||||||
$client = new \Memcached($options['persistent_id']);
|
$client = new \Memcached($options['persistent_id']);
|
||||||
$username = $options['username'];
|
$username = $options['username'];
|
||||||
|
Reference in New Issue
Block a user