本文整理汇总了PHP中Nette\Http\Session类的典型用法代码示例。如果您正苦于以下问题:PHP Session类的具体用法?PHP Session怎么用?PHP Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Session类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _before
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);
}
开发者ID:webchemistry,项目名称:forms-wizard,代码行数:7,代码来源:WizardTest.php
示例2: __construct
/**
* @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());
}
开发者ID:venne,项目名称:files,代码行数:12,代码来源:AjaxFileUploaderControl.php
示例3: __construct
/**
* @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;
}
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:AuthorizatorFactory.php
示例4: __construct
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;
}
开发者ID:venne,项目名称:venne,代码行数:7,代码来源:AuthorizatorFactory.php
示例5: __construct
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');
}
开发者ID:zaxxx,项目名称:zaxcms,代码行数:8,代码来源:DatabaseGenerator.php
示例6: __construct
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;
}
开发者ID:lukdanek,项目名称:linkedin-nette,代码行数:8,代码来源:Linkedin.php
示例7: __construct
/**
* @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;
}
开发者ID:vladahejda,项目名称:livetranslator,代码行数:14,代码来源:Translator.php
示例8: __construct
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;
}
开发者ID:venne,项目名称:files,代码行数:9,代码来源:FilesControl.php
示例9: __construct
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();
}
}
开发者ID:salamek,项目名称:gettexttranslator,代码行数:9,代码来源:Gettext.php
示例10: __construct
/**
* @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);
}
}
开发者ID:Hajneej,项目名称:PayPalExpress,代码行数:14,代码来源:PayControl.php
示例11: __construct
/**
* @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);
}
开发者ID:krupaj,项目名称:my-blog,代码行数:16,代码来源:CommentsFactory.php
示例12: __construct
/**
* @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();
}
开发者ID:salamek,项目名称:gettexttranslator,代码行数:18,代码来源:Panel.php
示例13: __construct
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();
}
*/
}
开发者ID:kosikcz,项目名称:gettext-translator,代码行数:12,代码来源:Gettext.php
示例14: __construct
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']);
}
开发者ID:milo,项目名称:github-api-nette,代码行数:12,代码来源:Panel.php
示例15: __construct
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;
}
开发者ID:shophp,项目名称:shophp,代码行数:12,代码来源:OrderService.php
示例16: getSessionSection
/**
* 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;
}
开发者ID:trejjam,项目名称:authorization,代码行数:17,代码来源:Storage.php
示例17: getStateSession
/**
* @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');
}
开发者ID:natrim,项目名称:visualpaginator,代码行数:10,代码来源:VisualPaginator.php
示例18: getFlashSession
/**
* 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]);
}
开发者ID:pdostal,项目名称:nette-blog,代码行数:11,代码来源:Presenter.php
示例19: getSession
/**
* @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);
}
开发者ID:voda,项目名称:application,代码行数:11,代码来源:Presenter.php
示例20: setSession
/**
* @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);
}
开发者ID:Kollarovic,项目名称:CaptchaControl,代码行数:14,代码来源:CaptchaControl.php
注:本文中的Nette\Http\Session类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论