本文整理汇总了PHP中Flux::parseConfigFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Flux::parseConfigFile方法的具体用法?PHP Flux::parseConfigFile怎么用?PHP Flux::parseConfigFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flux
的用法示例。
在下文中一共展示了Flux::parseConfigFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $addonDir = null)
{
$this->name = $name;
$this->addonDir = is_null($addonDir) ? FLUX_ADDON_DIR . "/{$name}" : $addonDir;
$this->configDir = "{$this->addonDir}/config";
$this->moduleDir = "{$this->addonDir}/modules";
$this->themeDir = "{$this->addonDir}/themes/" . Flux::config('ThemeName');
$files = array('addonConfig' => "{$this->configDir}/addon.php", 'accessConfig' => "{$this->configDir}/access.php");
foreach ($files as $configName => $filename) {
if (file_exists($filename)) {
$this->{$configName} = Flux::parseConfigFile($filename);
}
if (!$this->{$configName} instanceof Flux_Config) {
$tempArr = array();
$this->{$configName} = new Flux_Config($tempArr);
}
}
// Use new language system for messages (also supports addons).
$this->messagesConfig = Flux::parseLanguageConfigFile($name);
}
示例2: session_set_cookie_params
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')));
} catch (Exception $e) {
$exceptionDir = FLUX_DATA_DIR . '/logs/errors/exceptions';