start() public method

Starts and initializes session data.
public start ( ) : void
return void
コード例 #1
0
 protected function _before()
 {
     $this->session = new \Nette\Http\Session(new \Nette\Http\Request(new \Nette\Http\UrlScript()), new \Nette\Http\Response());
     $this->session = new \Kdyby\FakeSession\Session($this->session);
     $this->session->start();
     $this->wizard = new Wizard($this->session);
 }
コード例 #2
0
ファイル: SessionSection.php プロジェクト: jave007/test
 /**
  * Do not call directly. Use Session::getNamespace().
  */
 private function start()
 {
     if ($this->meta === FALSE) {
         $this->session->start();
         $this->data =& $_SESSION['__NF']['DATA'][$this->name];
         $this->meta =& $_SESSION['__NF']['META'][$this->name];
     }
 }
コード例 #3
0
 /**
  * @param string  $defaultLang
  * @param ITranslatorStorage $translatorStorage
  * @param Nette\Http\Session $session
  * @param Nette\Application\Application $application
  */
 public function __construct($defaultLang, ITranslatorStorage $translatorStorage, Nette\Http\Session $session, Nette\Application\Application $application)
 {
     $this->setDefaultLang($defaultLang);
     $this->translatorStorage = $translatorStorage;
     $session->start();
     $this->session = $session;
     $this->application = $application;
 }
コード例 #4
0
 /**
  * Registers CaptchaControl to the \Nette\Forms\Container, starts session and sets $defaultFontFile (if not set)
  *
  * @param \Nette\Http\Session $session session
  * @throws \Nette\InvalidStateException
  * @return void
  */
 public static function register(Session $session)
 {
     if (self::$registered === TRUE) {
         throw new InvalidStateException(__CLASS__ . ' is already registered.');
     }
     if ($session->isStarted() === FALSE) {
         $session->start();
     }
     self::$session = $session->getSection(__CLASS__);
     if (!self::$defaultFontFile) {
         self::$defaultFontFile = __DIR__ . '/fonts/Vera.ttf';
     }
     Container::extensionMethod('addCaptcha', function ($container, $name) {
         return $container[$name] = new static();
     });
     self::$registered = TRUE;
 }
コード例 #5
0
 /**
  * Register CaptchaControl to FormContainer, start session and set $defaultFontFile (if not set)
  * @return void
  * @throws \Nette\InvalidStateException
  */
 public static function register(Session $session)
 {
     if (self::$registered) {
         throw new \Nette\InvalidStateException(__CLASS__ . " is already registered");
     }
     if (!$session->isStarted()) {
         $session->start();
     }
     self::$session = $session->getSection(__CLASS__);
     if (!self::$defaultFontFile) {
         self::$defaultFontFile = __DIR__ . "/fonts/Vera.ttf";
     }
     FormContainer::extensionMethod('addCaptcha', callback(__CLASS__, 'addCaptcha'));
     self::$registered = TRUE;
 }
コード例 #6
0
 public function __construct(Container $container)
 {
     $this->container = $container;
     $this->session = $container->getByType('Nette\\Http\\Session');
     $this->session->start();
 }
コード例 #7
0
ファイル: CaptchaManager.php プロジェクト: kivi8/ars-poetica
 public function __construct(Session $session)
 {
     $this->session = $session;
     $this->sessSect = $session->getSection('session');
     $session->start();
 }