1
0
mirror of https://github.com/flarum/core.git synced 2025-10-26 21:21:28 +01:00
Files
php-flarum/src/User/SessionServiceProvider.php
Alexander Skvortsov c81f629b0b Rename app to container (#2609)
* Rename `app` helper to `resolve`, deprecate old version
* Rename $this->app to $this->container in service providers

We no longer couple Flarum\Foundation\Application to the Laravel container; instead, we use the container separately. Changing our naming to reflect that will make things clearer.
2021-03-04 22:14:48 -05:00

34 lines
849 B
PHP

<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\User;
use Flarum\Foundation\AbstractServiceProvider;
use Illuminate\Session\FileSessionHandler;
use SessionHandlerInterface;
class SessionServiceProvider extends AbstractServiceProvider
{
/**
* {@inheritdoc}
*/
public function register()
{
$this->container->singleton('session.handler', function ($container) {
return new FileSessionHandler(
$container['files'],
$container['config']['session.files'],
$container['config']['session.lifetime']
);
});
$this->container->alias('session.handler', SessionHandlerInterface::class);
}
}