示例#1
0
文件: Session.php 项目: forxer/tao
 /**
  * Constructor.
  *
  * @param SessionStorageInterface $storage    			A SessionStorageInterface instance.
  * @param AttributeBagInterface   $attributes 			An AttributeBagInterface instance, (defaults null for default AttributeBag)
  * @param FlashBagInterface       $flashes    			A FlashBagInterface instance (defaults null for default FlashBag)
  * @param FlashBagInterface       $autoExpireFlashBag   A FlashBagInterface instance (defaults null for default FlashBag)
  */
 public function __construct(Application $app, SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, FlashBagInterface $autoExpireFlashBag = null, $sTokenNamespace = 'csrf')
 {
     $this->app = $app;
     parent::__construct($storage, $attributes, $flashes);
     if (null === $autoExpireFlashBag) {
         $autoExpireFlashBag = new AutoExpireFlashBag();
     }
     $this->autoExpireFlashName = $autoExpireFlashBag->getName();
     $this->registerBag($autoExpireFlashBag);
     $this->start();
     $this->sTokenNamespace = $sTokenNamespace;
     $this->setToken();
 }
示例#2
0
 public function testGetSetName()
 {
     $this->assertEquals('flashes', $this->bag->getName());
     $this->bag->setName('foo');
     $this->assertEquals('foo', $this->bag->getName());
 }