summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation/Session
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2017-10-16 14:56:14 +0100
committerGreg Roach <fisharebest@gmail.com>2017-10-16 14:56:14 +0100
commit542cb0023a05d14b3bf09a1c6c99f99b4256eaa2 (patch)
treef56893fcd67f4f1c8c7da08f9344702d3b471852 /vendor/symfony/http-foundation/Session
parent14b849be814811cd4d8ef5390813857fac9669da (diff)
downloadwebtrees-542cb0023a05d14b3bf09a1c6c99f99b4256eaa2.tar.gz
webtrees-542cb0023a05d14b3bf09a1c6c99f99b4256eaa2.tar.bz2
webtrees-542cb0023a05d14b3bf09a1c6c99f99b4256eaa2.zip
Update vendor code
Diffstat (limited to 'vendor/symfony/http-foundation/Session')
-rw-r--r--vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Flash/FlashBag.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Session.php4
-rw-r--r--vendor/symfony/http-foundation/Session/SessionInterface.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php8
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php8
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php6
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php35
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MetadataBag.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php5
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php6
19 files changed, 39 insertions, 63 deletions
diff --git a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
index af292e37a4..57c297197b 100644
--- a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
+++ b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
@@ -29,8 +29,6 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
protected $attributes = array();
/**
- * Constructor.
- *
* @param string $storageKey The key used to store attributes in the session
*/
public function __construct($storageKey = '_sf2_attributes')
diff --git a/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php b/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
index d797a6f238..e149801aad 100644
--- a/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
+++ b/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
@@ -27,8 +27,6 @@ class NamespacedAttributeBag extends AttributeBag
private $namespaceCharacter;
/**
- * Constructor.
- *
* @param string $storageKey Session storage key
* @param string $namespaceCharacter Namespace character to use in keys
*/
@@ -109,7 +107,7 @@ class NamespacedAttributeBag extends AttributeBag
protected function &resolveAttributePath($name, $writeContext = false)
{
$array = &$this->attributes;
- $name = (strpos($name, $this->namespaceCharacter) === 0) ? substr($name, 1) : $name;
+ $name = (0 === strpos($name, $this->namespaceCharacter)) ? substr($name, 1) : $name;
// Check if there is anything to do, else return
if (!$name) {
diff --git a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
index ddd603fdd1..8110aee0cf 100644
--- a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
+++ b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
@@ -35,8 +35,6 @@ class AutoExpireFlashBag implements FlashBagInterface
private $storageKey;
/**
- * Constructor.
- *
* @param string $storageKey The key used to store flashes in the session
*/
public function __construct($storageKey = '_sf2_flashes')
diff --git a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
index 85b4f00b00..a86dc6c1a2 100644
--- a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
+++ b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
@@ -35,8 +35,6 @@ class FlashBag implements FlashBagInterface
private $storageKey;
/**
- * Constructor.
- *
* @param string $storageKey The key used to store flashes in the session
*/
public function __construct($storageKey = '_sf2_flashes')
diff --git a/vendor/symfony/http-foundation/Session/Session.php b/vendor/symfony/http-foundation/Session/Session.php
index 70bcf3e090..f063651a18 100644
--- a/vendor/symfony/http-foundation/Session/Session.php
+++ b/vendor/symfony/http-foundation/Session/Session.php
@@ -19,8 +19,6 @@ use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
- * Session.
- *
* @author Fabien Potencier <fabien@symfony.com>
* @author Drak <drak@zikula.org>
*/
@@ -44,8 +42,6 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
private $attributeName;
/**
- * Constructor.
- *
* @param SessionStorageInterface $storage A SessionStorageInterface instance
* @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag)
* @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag)
diff --git a/vendor/symfony/http-foundation/Session/SessionInterface.php b/vendor/symfony/http-foundation/Session/SessionInterface.php
index d3fcd2eec4..172c9b457f 100644
--- a/vendor/symfony/http-foundation/Session/SessionInterface.php
+++ b/vendor/symfony/http-foundation/Session/SessionInterface.php
@@ -25,7 +25,7 @@ interface SessionInterface
*
* @return bool True if session started
*
- * @throws \RuntimeException If session fails to start.
+ * @throws \RuntimeException if session fails to start
*/
public function start();
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
index 962a3878d9..d31aa7667e 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
/**
- * MemcacheSessionHandler.
- *
* @author Drak <drak@zikula.org>
*/
class MemcacheSessionHandler implements \SessionHandlerInterface
@@ -34,8 +32,6 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
private $prefix;
/**
- * Constructor.
- *
* List of available options:
* * prefix: The prefix to use for the memcache keys in order to avoid collision
* * expiretime: The time to live in seconds
@@ -95,7 +91,9 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
*/
public function destroy($sessionId)
{
- return $this->memcache->delete($this->prefix.$sessionId);
+ $this->memcache->delete($this->prefix.$sessionId);
+
+ return true;
}
/**
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
index 76b08e2db9..3bbde5420d 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
/**
- * MemcachedSessionHandler.
- *
* Memcached based session storage handler based on the Memcached class
* provided by the PHP memcached extension.
*
@@ -39,8 +37,6 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
private $prefix;
/**
- * Constructor.
- *
* List of available options:
* * prefix: The prefix to use for the memcached keys in order to avoid collision
* * expiretime: The time to live in seconds
@@ -101,7 +97,9 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
*/
public function destroy($sessionId)
{
- return $this->memcached->delete($this->prefix.$sessionId);
+ $result = $this->memcached->delete($this->prefix.$sessionId);
+
+ return $result || \Memcached::RES_NOTFOUND == $this->memcached->getResultCode();
}
/**
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
index 8408f000cd..f140939dbd 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
/**
- * MongoDB session handler.
- *
* @author Markus Bachmann <markus.bachmann@bachi.biz>
*/
class MongoDbSessionHandler implements \SessionHandlerInterface
@@ -34,8 +32,6 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
private $options;
/**
- * Constructor.
- *
* List of available options:
* * database: The name of the database [required]
* * collection: The name of the collection [required]
@@ -122,7 +118,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
*/
public function gc($maxlifetime)
{
- $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
+ $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteMany' : 'remove';
$this->getCollection()->$methodName(array(
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php
index 1be0a39837..d6ad93749f 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
/**
- * NativeFileSessionHandler.
- *
* Native session handler using PHP's built in file storage.
*
* @author Drak <drak@zikula.org>
@@ -21,8 +19,6 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
class NativeFileSessionHandler extends NativeSessionHandler
{
/**
- * Constructor.
- *
* @param string $savePath Path of directory to save session files
* Default null will leave setting as defined by PHP.
* '/path', 'N;/path', or 'N;octal-mode;/path
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
index 8909a5f401..5cdac63939 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -148,8 +148,6 @@ class PdoSessionHandler implements \SessionHandlerInterface
private $gcCalled = false;
/**
- * Constructor.
- *
* You can either pass an existing database connection as PDO instance or
* pass a DSN string that will be used to lazy-connect to the database
* when the session is actually used. Furthermore it's possible to pass null
@@ -580,11 +578,11 @@ class PdoSessionHandler implements \SessionHandlerInterface
return $releaseStmt;
case 'pgsql':
// Obtaining an exclusive session level advisory lock requires an integer key.
- // So we convert the HEX representation of the session id to an integer.
- // Since integers are signed, we have to skip one hex char to fit in the range.
- if (4 === PHP_INT_SIZE) {
- $sessionInt1 = hexdec(substr($sessionId, 0, 7));
- $sessionInt2 = hexdec(substr($sessionId, 7, 7));
+ // When session.sid_bits_per_character > 4, the session id can contain non-hex-characters.
+ // So we cannot just use hexdec().
+ if (4 === \PHP_INT_SIZE) {
+ $sessionInt1 = $this->convertStringToInt($sessionId);
+ $sessionInt2 = $this->convertStringToInt(substr($sessionId, 4, 4));
$stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key1, :key2)');
$stmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT);
@@ -595,7 +593,7 @@ class PdoSessionHandler implements \SessionHandlerInterface
$releaseStmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT);
$releaseStmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT);
} else {
- $sessionBigInt = hexdec(substr($sessionId, 0, 15));
+ $sessionBigInt = $this->convertStringToInt($sessionId);
$stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key)');
$stmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT);
@@ -614,6 +612,27 @@ class PdoSessionHandler implements \SessionHandlerInterface
}
/**
+ * Encodes the first 4 (when PHP_INT_SIZE == 4) or 8 characters of the string as an integer.
+ *
+ * Keep in mind, PHP integers are signed.
+ *
+ * @param string $string
+ *
+ * @return int
+ */
+ private function convertStringToInt($string)
+ {
+ if (4 === \PHP_INT_SIZE) {
+ return (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]);
+ }
+
+ $int1 = (ord($string[7]) << 24) + (ord($string[6]) << 16) + (ord($string[5]) << 8) + ord($string[4]);
+ $int2 = (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]);
+
+ return $int2 + ($int1 << 32);
+ }
+
+ /**
* Return a locking or nonlocking SQL query to read session information.
*
* @return string The SQL string
diff --git a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
index 322dd560f8..6f59af4869 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
@@ -54,8 +54,6 @@ class MetadataBag implements SessionBagInterface
private $updateThreshold;
/**
- * Constructor.
- *
* @param string $storageKey The key used to store bag in the session
* @param int $updateThreshold The time to wait between two UPDATED updates
*/
diff --git a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
index 348fd23018..0349a43367 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
@@ -63,8 +63,6 @@ class MockArraySessionStorage implements SessionStorageInterface
protected $bags = array();
/**
- * Constructor.
- *
* @param string $name Session name
* @param MetadataBag $metaBag MetadataBag instance
*/
diff --git a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
index 71f9e55512..8c1bf73cae 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
@@ -30,8 +30,6 @@ class MockFileSessionStorage extends MockArraySessionStorage
private $savePath;
/**
- * Constructor.
- *
* @param string $savePath Path of directory to save session files
* @param string $name Session name
* @param MetadataBag $metaBag MetadataBag instance
diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
index 97161b8d0f..8f4ebefaab 100644
--- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
@@ -52,8 +52,6 @@ class NativeSessionStorage implements SessionStorageInterface
protected $metadataBag;
/**
- * Constructor.
- *
* Depending on how you want the storage driver to behave you probably
* want to override this constructor entirely.
*
diff --git a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
index 6f02a7fd73..9420d086ca 100644
--- a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
@@ -22,8 +22,6 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandle
class PhpBridgeSessionStorage extends NativeSessionStorage
{
/**
- * Constructor.
- *
* @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler
* @param MetadataBag $metaBag MetadataBag
*/
diff --git a/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php b/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php
index 0db34aa28d..21ed1ada04 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php
@@ -12,17 +12,12 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
/**
- * NativeProxy.
- *
* This proxy is built-in session handlers in PHP 5.3.x
*
* @author Drak <drak@zikula.org>
*/
class NativeProxy extends AbstractProxy
{
- /**
- * Constructor.
- */
public function __construct()
{
// this makes an educated guess as to what the handler is since it should already be set.
diff --git a/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php b/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php
index 68ed713c22..be39f6baeb 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
/**
- * SessionHandler proxy.
- *
* @author Drak <drak@zikula.org>
*/
class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
@@ -24,8 +22,6 @@ class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterf
protected $handler;
/**
- * Constructor.
- *
* @param \SessionHandlerInterface $handler
*/
public function __construct(\SessionHandlerInterface $handler)
diff --git a/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php
index 34f6c4633f..097583d5a5 100644
--- a/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php
+++ b/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php
@@ -26,7 +26,7 @@ interface SessionStorageInterface
*
* @return bool True if started
*
- * @throws \RuntimeException If something goes wrong starting the session.
+ * @throws \RuntimeException if something goes wrong starting the session
*/
public function start();
@@ -104,8 +104,8 @@ interface SessionStorageInterface
* a real PHP session would interfere with testing, in which case
* it should actually persist the session data if required.
*
- * @throws \RuntimeException If the session is saved without being started, or if the session
- * is already closed.
+ * @throws \RuntimeException if the session is saved without being started, or if the session
+ * is already closed
*/
public function save();