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); }
/** * 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]; } }
/** * @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; }
/** * 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; }
/** * 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; }
public function __construct(Container $container) { $this->container = $container; $this->session = $container->getByType('Nette\\Http\\Session'); $this->session->start(); }
public function __construct(Session $session) { $this->session = $session; $this->sessSect = $session->getSection('session'); $session->start(); }