mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
update to laravel 5.7 and try getting autologin saved
This commit is contained in:
@@ -71,7 +71,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
private $pdo;
|
||||
|
||||
/**
|
||||
* @var string|null|false DSN string or null for session.save_path or false when lazy connection disabled
|
||||
* @var string|false|null DSN string or null for session.save_path or false when lazy connection disabled
|
||||
*/
|
||||
private $dsn = false;
|
||||
|
||||
@@ -178,7 +178,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
|
||||
$this->pdo = $pdoOrDsn;
|
||||
$this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
|
||||
} elseif (is_string($pdoOrDsn) && false !== strpos($pdoOrDsn, '://')) {
|
||||
} elseif (\is_string($pdoOrDsn) && false !== strpos($pdoOrDsn, '://')) {
|
||||
$this->dsn = $this->buildDsnFromUrl($pdoOrDsn);
|
||||
} else {
|
||||
$this->dsn = $pdoOrDsn;
|
||||
@@ -629,7 +629,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
return '';
|
||||
}
|
||||
|
||||
return is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0];
|
||||
return \is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0];
|
||||
}
|
||||
|
||||
if (null !== $insertStmt) {
|
||||
@@ -668,8 +668,6 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* Executes an application-level lock on the database.
|
||||
*
|
||||
* @param string $sessionId Session ID
|
||||
*
|
||||
* @return \PDOStatement The statement that needs to be executed later to release the lock
|
||||
*
|
||||
* @throws \DomainException When an unsupported PDO driver is used
|
||||
@@ -678,7 +676,7 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
* - for oci using DBMS_LOCK.REQUEST
|
||||
* - for sqlsrv using sp_getapplock with LockOwner = Session
|
||||
*/
|
||||
private function doAdvisoryLock($sessionId)
|
||||
private function doAdvisoryLock(string $sessionId)
|
||||
{
|
||||
switch ($this->driver) {
|
||||
case 'mysql':
|
||||
@@ -733,19 +731,15 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
* 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)
|
||||
private function convertStringToInt(string $string): int
|
||||
{
|
||||
if (4 === \PHP_INT_SIZE) {
|
||||
return (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]);
|
||||
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]);
|
||||
$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);
|
||||
}
|
||||
@@ -753,11 +747,9 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* Return a locking or nonlocking SQL query to read session information.
|
||||
*
|
||||
* @return string The SQL string
|
||||
*
|
||||
* @throws \DomainException When an unsupported PDO driver is used
|
||||
*/
|
||||
private function getSelectSql()
|
||||
private function getSelectSql(): string
|
||||
{
|
||||
if (self::LOCK_TRANSACTIONAL === $this->lockMode) {
|
||||
$this->beginTransaction();
|
||||
@@ -848,14 +840,8 @@ class PdoSessionHandler extends AbstractSessionHandler
|
||||
|
||||
/**
|
||||
* Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data.
|
||||
*
|
||||
* @param string $sessionId Session ID
|
||||
* @param string $data Encoded session data
|
||||
* @param int $maxlifetime session.gc_maxlifetime
|
||||
*
|
||||
* @return \PDOStatement|null The merge statement or null when not supported
|
||||
*/
|
||||
private function getMergeStatement($sessionId, $data, $maxlifetime)
|
||||
private function getMergeStatement(string $sessionId, string $data, int $maxlifetime): ?\PDOStatement
|
||||
{
|
||||
switch (true) {
|
||||
case 'mysql' === $this->driver:
|
||||
|
||||
Reference in New Issue
Block a user