[HttpFoundation] Further micro-optimization.
This commit is contained in:
parent
54c5d5ed32
commit
8dd2c273d3
@ -51,16 +51,16 @@ class NativeMemcacheSessionHandler extends NativeSessionHandler
|
||||
*/
|
||||
protected function setOptions(array $options)
|
||||
{
|
||||
$validOptions = array(
|
||||
$validOptions = array_flip(array(
|
||||
'memcache.allow_failover', 'memcache.max_failover_attempts',
|
||||
'memcache.chunk_size', 'memcache.default_port', 'memcache.hash_strategy',
|
||||
'memcache.hash_function', 'memcache.protocol', 'memcache.redundancy',
|
||||
'memcache.session_redundancy', 'memcache.compress_threshold',
|
||||
'memcache.lock_timeout'
|
||||
);
|
||||
'memcache.lock_timeout',
|
||||
));
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
if (in_array($key, $validOptions)) {
|
||||
if (isset($validOptions[$key])) {
|
||||
ini_set($key, $value);
|
||||
}
|
||||
}
|
||||
|
@ -51,15 +51,15 @@ class NativeMemcachedSessionHandler extends NativeSessionHandler
|
||||
*/
|
||||
protected function setOptions(array $options)
|
||||
{
|
||||
$validOptions = array(
|
||||
$validOptions = array_flip(array(
|
||||
'memcached.sess_locking', 'memcached.sess_lock_wait',
|
||||
'memcached.sess_prefix', 'memcached.compression_type',
|
||||
'memcached.compression_factor', 'memcached.compression_threshold',
|
||||
'memcached.serializer'
|
||||
);
|
||||
'memcached.serializer',
|
||||
));
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
if (in_array($key, $validOptions)) {
|
||||
if (isset($validOptions[$key])) {
|
||||
ini_set($key, $value);
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$validOptions = array(
|
||||
$validOptions = array_flip(array(
|
||||
'auto_start', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
|
||||
'cookie_lifetime', 'cookie_path', 'cookie_secure',
|
||||
'entropy_file', 'entropy_length', 'gc_divisor',
|
||||
@ -270,11 +270,11 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
'serialize_handler', 'use_cookies',
|
||||
'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled',
|
||||
'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name',
|
||||
'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags'
|
||||
);
|
||||
'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags',
|
||||
));
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
if (in_array($key, $validOptions)) {
|
||||
if (isset($validOptions[$key])) {
|
||||
ini_set('session.'.$key, $value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user