コード例 #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
 protected function setUp()
 {
     parent::setUp();
     $this->bag = new FlashBag();
     $this->array = array('new' => array('notice' => array('A previous flash message')));
     $this->bag->initialize($this->array);
 }
コード例 #3
0
 public function testClear()
 {
     $this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear());
 }
コード例 #4
0
 /**
  * Constructor.
  *
  * @param string $name
  * @param string $storageKey
  */
 public function __construct($name = 'messages', $storageKey = '_pk_messages')
 {
     parent::__construct($storageKey);
     $this->setName($name);
 }