mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-15 11:23:47 +09:00
Update dependencies
This commit is contained in:
@@ -19,22 +19,18 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||
class NativeFileSessionHandler extends \SessionHandler
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
* @param string|null $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
|
||||
*
|
||||
* @see https://php.net/session.configuration#ini.session.save-path for further details.
|
||||
*
|
||||
* @throws \InvalidArgumentException On invalid $savePath
|
||||
* @throws \RuntimeException When failing to create the save directory
|
||||
*/
|
||||
public function __construct(string $savePath = null)
|
||||
public function __construct(?string $savePath = null)
|
||||
{
|
||||
if (null === $savePath) {
|
||||
$savePath = \ini_get('session.save_path');
|
||||
}
|
||||
|
||||
$baseDir = $savePath;
|
||||
$baseDir = $savePath ??= \ini_get('session.save_path');
|
||||
|
||||
if ($count = substr_count($savePath, ';')) {
|
||||
if ($count > 2) {
|
||||
@@ -49,7 +45,11 @@ class NativeFileSessionHandler extends \SessionHandler
|
||||
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir));
|
||||
}
|
||||
|
||||
ini_set('session.save_path', $savePath);
|
||||
ini_set('session.save_handler', 'files');
|
||||
if ($savePath !== \ini_get('session.save_path')) {
|
||||
ini_set('session.save_path', $savePath);
|
||||
}
|
||||
if ('files' !== \ini_get('session.save_handler')) {
|
||||
ini_set('session.save_handler', 'files');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user