作者:webchemistr
项目:forms-wizar
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);
}
作者:venn
项目:file
/**
* @param \Nette\ComponentModel\IContainer $ajaxDir
* @param string $ajaxPath
* @param \Nette\Http\Session $session
*/
public function __construct($ajaxDir, $ajaxPath, Session $session)
{
parent::__construct();
$this->ajaxDir = $ajaxDir;
$this->ajaxPath = $ajaxPath;
$this->sessionSection = $session->getSection('ajaxUploader-' . $this->getName());
}
作者:svobodn
项目:we
/**
* @param PresenterFactory $presenterFactory
* @param BaseRepository $roleRepository
* @param Session $session
*/
public function __construct(PresenterFactory $presenterFactory, BaseRepository $roleRepository, Session $session, Callback $checkConnection)
{
$this->presenterFactory = $presenterFactory;
$this->roleRepository = $roleRepository;
$this->session = $session->getSection(self::SESSION_SECTION);
$this->checkConnection = $checkConnection;
}
作者:venn
项目:venn
public function __construct(EntityManager $entityManager, Session $session, AdministrationManager $administrationManager)
{
$this->roleRepository = $entityManager->getRepository(Role::class);
$this->permissionRepository = $entityManager->getRepository(Permission::class);
$this->session = $session->getSection(self::SESSION_SECTION);
$this->administrationManager = $administrationManager;
}
作者:zaxx
项目:zaxcm
public function __construct(Kdyby\Doctrine\EntityManager $em, Zax\Utils\AppDir $appDir, Nette\Http\Session $session)
{
$this->em = $em;
$this->schemaTool = new Doctrine\ORM\Tools\SchemaTool($this->em);
$cacheStorage = new Nette\Caching\Storages\FileStorage($appDir . '/modules/Install/components/Install/installSchema');
$this->cache = new Nette\Caching\Cache($cacheStorage);
$this->sessionSection = $session->getSection('ZaxCMS.DatabaseGenerator');
}
作者:lukdane
项目:linkedin-nett
public function __construct(\Nette\Http\Session $session, \Fabian\Linkedin\Configuration $config)
{
$this->session = $session->getSection('linkedin');
if (isset($this->session->access_token)) {
$this->accessToken = $this->session->access_token;
}
$this->config = $config;
}
作者:vladahejd
项目:livetranslato
/**
* @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;
}
作者:venn
项目:file
public function __construct(EntityManager $entityManager, Session $session, IBrowserControlFactory $browserFactory)
{
parent::__construct();
$this->entityManager = $entityManager;
$this->fileRepository = $entityManager->getRepository(File::class);
$this->dirRepository = $entityManager->getRepository(Dir::class);
$this->session = $session->getSection('Venne.Content.filesSide');
$this->browserFactory = $browserFactory;
}
作者:salame
项目:gettexttranslato
public function __construct(Nette\Http\Session $session, Nette\Caching\IStorage $cacheStorage, Nette\Http\Response $httpResponse)
{
$this->sessionStorage = $sessionStorage = $session->getSection(self::$namespace);
$this->cache = new Nette\Caching\Cache($cacheStorage, self::$namespace);
$this->httpResponse = $httpResponse;
if (!isset($sessionStorage->newStrings) || !is_array($sessionStorage->newStrings)) {
$sessionStorage->newStrings = array();
}
}
作者:Hajnee
项目:PayPalExpres
/**
* @param PayPal $payPal
* @param Session $session
*/
public function __construct(PayPal $payPal, Session $session)
{
parent::__construct();
$this->payPal = $payPal;
$this->session = $session->getSection('PayPalExpress');
$this->session->setExpiration('+10 minutes');
if (empty($this->session->token)) {
$this->session->token = $this->_ec = Strings::random(6);
}
}
作者:krupa
项目:my-blo
/**
* @param Article $article Clanek, ktery se komentuje
* @param \Nette\Http\Session $session Session pro ulozeni hodnot pri nahledu komentare
* @param \Kdyby\Translation\Translator $translator Prekladac
* @param \App\Model\Repository\ArticleRepository $repository
*/
public function __construct(Article $article, \Nette\Http\Session $session, \Kdyby\Translation\Translator $translator, \App\Model\Repository\ArticleRepository $repository)
{
$this->article = $article;
$this->commentSession = $session->getSection('comments');
$this->translator = $translator;
$this->articleRepository = $repository;
$this->paginator = new \Nette\Utils\Paginator();
$this->paginator->setItemsPerPage(self::COMMENT_PER_PAGE);
$this->paginator->setPage(1);
}
作者:salame
项目:gettexttranslato
/**
* @param Nette\Application\Application
* @param Gettext\Translator\Gettext
* @param Nette\Http\Session
* @param Nette\Http\Request
* @param string
* @param int
*/
public function __construct(Nette\Application\Application $application, Gettext $translator, Nette\Http\Session $session, Nette\Http\Request $httpRequest, $layout, $height)
{
$this->application = $application;
$this->translator = $translator;
$this->sessionStorage = $session->getSection(Gettext::$namespace);
$this->httpRequest = $httpRequest;
$this->height = $height;
$this->layout = $layout;
$this->processRequest();
}
作者:kosikc
项目:gettext-translato
public function __construct(Nette\Http\Session $session, Nette\Caching\IStorage $cacheStorage, Nette\Http\Response $httpResponse, FileManager $fileManager)
{
$this->sessionStorage = $sessionStorage = $session->getSection(self::$namespace);
$this->cache = new Nette\Caching\Cache(new Nette\Caching\Storages\DevNullStorage(), self::$namespace);
$this->httpResponse = $httpResponse;
$this->fileManager = $fileManager;
/*
if (!isset($sessionStorage->newStrings) || !is_array($sessionStorage->newStrings)) {
$sessionStorage->newStrings = array();
}
*/
}
作者:mil
项目:github-api-nett
public function __construct(Messages $messages, Nette\Http\Session $session, Github\Api $api, User $user = NULL)
{
$this->session = $session->getSection('milo.github.nette-extension');
$this->api = $api;
$this->user = $user;
foreach ($messages->getAll() as $message) {
$this->onMessage($message);
}
# Change handler
$api->getClient()->onRequest([$this, 'onMessage']);
$api->getClient()->onResponse([$this, 'onMessage']);
}
作者:shoph
项目:shoph
public function __construct(EntityManagerInterface $entityManager, Session $session, $cashPaymentAvailable, $bankPaymentAvailable, $cardPaymentAvailable)
{
parent::__construct($entityManager);
$this->repository = $entityManager->getRepository(Order::class);
$this->entityManager = $entityManager;
$orderSession = $session->getSection('order');
$orderSession->setExpiration('+ 30 minutes');
$this->orderSession = $orderSession;
$this->cashPaymentAvailable = (bool) $cashPaymentAvailable;
$this->bankPaymentAvailable = (bool) $bankPaymentAvailable;
$this->cardPaymentAvailable = (bool) $cardPaymentAvailable;
}
作者:trejja
项目:authorizatio
/**
* Returns and initializes $this->sessionSection.
* @return Nette\Http\SessionSection
*/
protected function getSessionSection($need)
{
$ret = parent::getSessionSection($need);
if (!is_null($ret)) {
if ($ret->authenticated && $ret->identity->browser !== $this->browser->getName() && $ret->identity->browserVersion !== $this->browser->getVersion()) {
$ret->authenticated = FALSE;
$this->sessionHandler->regenerateId();
$ret->reason = static::MANUAL;
$ret->authTime = NULL;
}
}
return $ret;
}
作者:natri
项目:visualpaginato
/**
* @return \Nette\Http\SessionSection
*/
protected function getStateSession()
{
if (is_null($this->session)) {
throw new \Nette\InvalidStateException('Session is not set! Use \'setSession\' to set session!');
}
return $this->session->getSection('VisualPaginator/' . $this->lookupPath('Nette\\ComponentModel\\IComponent', FALSE) ?: $this->getName() . '/states');
}
作者:pdosta
项目:nette-blo
/**
* Returns session namespace provided to pass temporary data between redirects.
* @return Nette\Http\SessionSection
*/
public function getFlashSession()
{
if (empty($this->params[self::FLASH_KEY])) {
$this->params[self::FLASH_KEY] = Nette\Utils\Strings::random(4);
}
return $this->session->getSection('Nette.Application.Flash/' . $this->params[self::FLASH_KEY]);
}
作者:vod
项目:applicatio
/**
* @param string
* @return Nette\Http\Session|Nette\Http\SessionSection
*/
public function getSession($namespace = NULL)
{
if (!$this->session) {
throw new Nette\InvalidStateException('Service Session has not been set.');
}
return $namespace === NULL ? $this->session : $this->session->getSection($namespace);
}
作者:Kollarovi
项目:CaptchaContro
/**
* @param string
* @param string
* @return void
* @throws \Nette\InvalidStateException
*/
private function setSession($uid, $word)
{
if (!self::$session) {
throw new \Nette\InvalidStateException(__CLASS__ . ' session not found');
}
self::$session->{$uid} = $word;
self::$session->setExpiration($this->getExpire(), $uid);
}