本文整理匯總了PHP中Flux::sessionData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flux::sessionData方法的具體用法?PHP Flux::sessionData怎麽用?PHP Flux::sessionData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flux
的用法示例。
在下文中一共展示了Flux::sessionData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
// Installer library.
$installer = Flux_Installer::getInstance();
if ($hasUpdates = $installer->updateNeeded()) {
Flux::config('ThemeName', 'installer');
}
$sessionKey = Flux::config('SessionKey');
$sessionExpireDuration = Flux::config('SessionCookieExpire') * 60 * 60;
session_set_cookie_params($sessionExpireDuration, Flux::config('BaseURI'));
ini_set('session.gc_maxlifetime', $sessionExpireDuration);
ini_set('session.name', $sessionKey);
@session_start();
if (empty($_SESSION[$sessionKey]) || !is_array($_SESSION[$sessionKey])) {
$_SESSION[$sessionKey] = array();
}
// Initialize session data.
Flux::$sessionData = new Flux_SessionData($_SESSION[$sessionKey], $hasUpdates);
// Initialize authorization component.
$accessConfig = Flux::parseConfigFile(FLUX_CONFIG_DIR . '/access.php');
// Merge with add-on configs.
foreach (Flux::$addons as $addon) {
$accessConfig->merge($addon->accessConfig);
}
$accessConfig->set('unauthorized.index', AccountLevel::ANYONE);
$authComponent = Flux_Authorization::getInstance($accessConfig, Flux::$sessionData);
if (!Flux::config('DebugMode')) {
ini_set('display_errors', 0);
}
// Dispatch requests->modules->actions->views.
$dispatcher = Flux_Dispatcher::getInstance();
$dispatcher->setDefaultModule(Flux::config('DefaultModule'));
$dispatcher->dispatch(array('basePath' => Flux::config('BaseURI'), 'useCleanUrls' => Flux::config('UseCleanUrls'), 'modulePath' => FLUX_MODULE_DIR, 'themePath' => FLUX_THEME_DIR, 'themeName' => Flux::$sessionData->theme, 'missingActionModuleAction' => Flux::config('DebugMode') ? array('errors', 'missing_action') : array('main', 'page_not_found'), 'missingViewModuleAction' => Flux::config('DebugMode') ? array('errors', 'missing_view') : array('main', 'page_not_found')));