updated packages
This commit is contained in:
@@ -104,7 +104,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
|
||||
{
|
||||
if (null === $this->igbinaryEmptyData) {
|
||||
// see https://github.com/igbinary/igbinary/issues/146
|
||||
$this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize(array()) : '';
|
||||
$this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize([]) : '';
|
||||
}
|
||||
if ('' === $data || $this->igbinaryEmptyData === $data) {
|
||||
return $this->destroy($sessionId);
|
||||
|
||||
@@ -45,11 +45,11 @@ class MemcachedSessionHandler extends AbstractSessionHandler
|
||||
*
|
||||
* @throws \InvalidArgumentException When unsupported options are passed
|
||||
*/
|
||||
public function __construct(\Memcached $memcached, array $options = array())
|
||||
public function __construct(\Memcached $memcached, array $options = [])
|
||||
{
|
||||
$this->memcached = $memcached;
|
||||
|
||||
if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) {
|
||||
if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) {
|
||||
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
return true;
|
||||
return $this->memcached->quit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,12 +74,12 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
|
||||
$this->mongo = $mongo;
|
||||
|
||||
$this->options = array_merge(array(
|
||||
$this->options = array_merge([
|
||||
'id_field' => '_id',
|
||||
'data_field' => 'data',
|
||||
'time_field' => 'time',
|
||||
'expiry_field' => 'expires_at',
|
||||
), $options);
|
||||
], $options);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,9 +95,9 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
*/
|
||||
protected function doDestroy($sessionId)
|
||||
{
|
||||
$this->getCollection()->deleteOne(array(
|
||||
$this->getCollection()->deleteOne([
|
||||
$this->options['id_field'] => $sessionId,
|
||||
));
|
||||
]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -107,9 +107,9 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
*/
|
||||
public function gc($maxlifetime)
|
||||
{
|
||||
$this->getCollection()->deleteMany(array(
|
||||
$this->options['expiry_field'] => array('$lt' => new \MongoDB\BSON\UTCDateTime()),
|
||||
));
|
||||
$this->getCollection()->deleteMany([
|
||||
$this->options['expiry_field'] => ['$lt' => new \MongoDB\BSON\UTCDateTime()],
|
||||
]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -121,16 +121,16 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
{
|
||||
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
|
||||
|
||||
$fields = array(
|
||||
$fields = [
|
||||
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
|
||||
$this->options['expiry_field'] => $expiry,
|
||||
$this->options['data_field'] => new \MongoDB\BSON\Binary($data, \MongoDB\BSON\Binary::TYPE_OLD_BINARY),
|
||||
);
|
||||
];
|
||||
|
||||
$this->getCollection()->updateOne(
|
||||
array($this->options['id_field'] => $sessionId),
|
||||
array('$set' => $fields),
|
||||
array('upsert' => true)
|
||||
[$this->options['id_field'] => $sessionId],
|
||||
['$set' => $fields],
|
||||
['upsert' => true]
|
||||
);
|
||||
|
||||
return true;
|
||||
@@ -144,11 +144,11 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
|
||||
|
||||
$this->getCollection()->updateOne(
|
||||
array($this->options['id_field'] => $sessionId),
|
||||
array('$set' => array(
|
||||
[$this->options['id_field'] => $sessionId],
|
||||
['$set' => [
|
||||
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
|
||||
$this->options['expiry_field'] => $expiry,
|
||||
))
|
||||
]]
|
||||
);
|
||||
|
||||
return true;
|
||||
@@ -159,10 +159,10 @@ class MongoDbSessionHandler extends AbstractSessionHandler
|
||||
*/
|
||||
protected function doRead($sessionId)
|
||||
{
|
||||
$dbData = $this->getCollection()->findOne(array(
|
||||
$dbData = $this->getCollection()->findOne([
|
||||
$this->options['id_field'] => $sessionId,
|
||||
$this->options['expiry_field'] => array('$gte' => new \MongoDB\BSON\UTCDateTime()),
|
||||
));
|
||||
$this->options['expiry_field'] => ['$gte' => new \MongoDB\BSON\UTCDateTime()],
|
||||
]);
|
||||
|
||||
if (null === $dbData) {
|
||||
return '';
|
||||
|
||||
@@ -118,7 +118,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* @var array Connection options when lazy-connect
|
||||
*/
|
||||
private $connectionOptions = array();
|
||||
private $connectionOptions = [];
|
||||
|
||||
/**
|
||||
* @var int The strategy for locking, see constants
|
||||
@@ -130,7 +130,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
*
|
||||
* @var \PDOStatement[] An array of statements to release advisory locks
|
||||
*/
|
||||
private $unlockStatements = array();
|
||||
private $unlockStatements = [];
|
||||
|
||||
/**
|
||||
* @var bool True when the current session exists but expired according to session.gc_maxlifetime
|
||||
@@ -161,7 +161,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
* * db_time_col: The column where to store the timestamp [default: sess_time]
|
||||
* * db_username: The username when lazy-connect [default: '']
|
||||
* * db_password: The password when lazy-connect [default: '']
|
||||
* * db_connection_options: An array of driver-specific connection options [default: array()]
|
||||
* * db_connection_options: An array of driver-specific connection options [default: []]
|
||||
* * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
|
||||
*
|
||||
* @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null
|
||||
@@ -169,7 +169,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
*
|
||||
* @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
|
||||
*/
|
||||
public function __construct($pdoOrDsn = null, array $options = array())
|
||||
public function __construct($pdoOrDsn = null, array $options = [])
|
||||
{
|
||||
if ($pdoOrDsn instanceof \PDO) {
|
||||
if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
|
||||
@@ -468,13 +468,13 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler');
|
||||
}
|
||||
|
||||
$driverAliasMap = array(
|
||||
$driverAliasMap = [
|
||||
'mssql' => 'sqlsrv',
|
||||
'mysql2' => 'mysql', // Amazon RDS, for some weird reason
|
||||
'postgres' => 'pgsql',
|
||||
'postgresql' => 'pgsql',
|
||||
'sqlite3' => 'sqlite',
|
||||
);
|
||||
];
|
||||
|
||||
$driver = isset($driverAliasMap[$params['scheme']]) ? $driverAliasMap[$params['scheme']] : $params['scheme'];
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
*
|
||||
* @throws \InvalidArgumentException When unsupported client or options are passed
|
||||
*/
|
||||
public function __construct($redis, array $options = array())
|
||||
public function __construct($redis, array $options = [])
|
||||
{
|
||||
if (
|
||||
!$redis instanceof \Redis &&
|
||||
@@ -52,7 +52,7 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
|
||||
}
|
||||
|
||||
if ($diff = array_diff(array_keys($options), array('prefix'))) {
|
||||
if ($diff = array_diff(array_keys($options), ['prefix'])) {
|
||||
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user