mirror of
https://github.com/getgrav/grav.git
synced 2026-03-01 18:11:25 +01:00
Minor code cleanup
This commit is contained in:
@@ -18,6 +18,7 @@ use Grav\Common\Utils;
|
||||
use Grav\Events\PluginsLoadedEvent;
|
||||
use Grav\Framework\Psr7\Response;
|
||||
use Grav\Framework\Session\Exceptions\SessionException;
|
||||
use Grav\Framework\Session\SessionInterface;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Handler\SyslogHandler;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
@@ -215,10 +216,13 @@ class InitializeProcessor extends ProcessorBase
|
||||
// TODO: remove in 2.0.
|
||||
$this->container['accounts'];
|
||||
|
||||
/** @var SessionInterface $session */
|
||||
$session = $this->container['session'];
|
||||
|
||||
try {
|
||||
$this->container['session']->init();
|
||||
$session->init();
|
||||
} catch (SessionException $e) {
|
||||
$this->container['session']->init();
|
||||
$session->init();
|
||||
$message = 'Session corruption detected, restarting session...';
|
||||
$this->addMessage($message);
|
||||
$this->container['messages']->add($message, 'error');
|
||||
|
||||
@@ -23,7 +23,7 @@ class SessionServiceProvider implements ServiceProviderInterface
|
||||
public function register(Container $container)
|
||||
{
|
||||
// Define session service.
|
||||
$container['session'] = function ($c) {
|
||||
$container['session'] = static function ($c) {
|
||||
/** @var Config $config */
|
||||
$config = $c['config'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user