本文整理匯總了PHP中eZSession::lazyStart方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZSession::lazyStart方法的具體用法?PHP eZSession::lazyStart怎麽用?PHP eZSession::lazyStart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZSession
的用法示例。
在下文中一共展示了eZSession::lazyStart方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sessionInit
/**
* Initializes the session. If running, through Symfony the session
* parameters from Symfony override the session parameter from eZ Publish.
*/
protected function sessionInit()
{
if (!isset($this->settings['session']) || !$this->settings['session']['configured']) {
// running without Symfony2 or session is not configured
// we keep the historic behaviour
$ini = eZINI::instance();
if ($ini->variable('Session', 'ForceStart') === 'enabled') {
eZSession::start();
} else {
eZSession::lazyStart();
}
} else {
$sfHandler = new ezpSessionHandlerSymfony($this->settings['session']['has_previous'] || $this->settings['session']['started']);
$sfHandler->setStorage($this->settings['session']['storage']);
eZSession::init($this->settings['session']['name'], $this->settings['session']['started'], $this->settings['session']['namespace'], $sfHandler);
}
// let session specify if db is required
$this->siteBasics['db-required'] = eZSession::getHandlerInstance()->dbRequired();
}
示例2: eZSessionBasketRegenerate
}
// Fill in hooks
eZSession::addCallback('destroy_pre', 'eZSessionBasketDestroy');
eZSession::addCallback('gc_pre', 'eZSessionBasketGarbageCollector');
eZSession::addCallback('cleanup_pre', 'eZSessionBasketCleanup');
}
// addCallBack to update session id for shop basket on session regenerate
function eZSessionBasketRegenerate($db, $escNewKey, $escOldKey, $escUserID)
{
$db->query("UPDATE ezbasket SET session_id='{$escNewKey}' WHERE session_id='{$escOldKey}'");
}
eZSession::addCallback('regenerate_post', 'eZSessionBasketRegenerate');
if ($ini->variable('Session', 'ForceStart') === 'enabled') {
eZSession::start();
} else {
eZSession::lazyStart();
}
// let session specify if db is required
$dbRequired = eZSession::getHandlerInstance()->dbRequired();
}
// if $dbRequired, open a db connection and check that db is connected
if ($dbRequired && !eZDB::instance()->isConnected()) {
$warningList[] = array('error' => array('type' => 'kernel', 'number' => eZError::KERNEL_NO_DB_CONNECTION), 'text' => 'No database connection could be made, the system might not behave properly.');
}
// eZCheckUser: pre check, RequireUserLogin & FORCE_LOGIN related so needs to be after session init
if (!isset($check)) {
$check = eZUserLoginHandler::preCheck($siteBasics, $uri);
}
/**
* Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
* @uses eZUser::instance() So needs to be executed after eZSession::start()|lazyStart()