本文整理汇总了PHP中Nette\Http\Session类的典型用法代码示例。如果您正苦于以下问题:PHP Session类的具体用法?PHP Session怎么用?PHP Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Session类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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());
}
示例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;
}
示例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;
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例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();
}
示例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();
}
*/
}
示例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']);
}
示例15: setDebugMode
/**
* Sets debug mode.
* @param boolean $debugMode
*/
public function setDebugMode($debugMode)
{
$this->debugMode = $debugMode;
if ($debugMode === true) {
$this->sessionStorage = $this->session->getSection(Gettext::$namespace);
}
}