コード例 #1
0
 public function register()
 {
     $this->ioc->singleton(SessionManager::class, function () {
         $manager = new SessionManager();
         $manager->setHandler($this->ioc->make(TransientSessionStorage::class));
         return $manager;
     });
 }
コード例 #2
0
 public function register()
 {
     $def = new EntityDefinition(Session::class);
     $def->id(Sha256StrongHash::class)->mapsTo('token');
     $def->required('data', Text::class);
     $def->timestamps();
     $this->remodel->register($def);
     $this->ioc->singleton(SessionGateway::class, SessionGateway::class);
     $this->ioc->singleton(SessionRepository::class, SessionRepository::class);
     $this->ioc->singleton(SessionManager::class, function () {
         $manager = new SessionManager();
         $manager->setHandler($this->ioc->make(DatabaseSessionStorage::class));
         return $manager;
     });
 }