本文整理汇总了PHP中ConfigFile::opened方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigFile::opened方法的具体用法?PHP ConfigFile::opened怎么用?PHP ConfigFile::opened使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::opened方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initTheme
public function initTheme()
{
$result = false;
if (strlen($this->mTheme)) {
global $gEnv;
import('com.solarix.ampoliros.core.Ampoliros');
$amp = Ampoliros::instance('Ampoliros');
if ($this->mTheme == 'default') {
$this->mTheme = $gEnv['hui']['theme']['default'];
}
if ($this->mTheme != 'userdefined') {
if (file_exists(CONFIG_PATH . $this->mTheme . '.huitheme')) {
$this->mThemeFile = CONFIG_PATH . $this->mTheme . '.huitheme';
} else {
$this->mTheme = $gEnv['hui']['theme']['default'];
$this->mThemeFile = CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme';
}
OpenLibrary('configman.library');
$cfg_file = new ConfigFile($this->mThemeFile);
if ($cfg_file->opened()) {
$this->mIconsSetName = $cfg_file->Value('THEME.ICONSSET');
$this->mColorsSetName = $cfg_file->Value('THEME.COLORSSET');
$this->mStyleName = $cfg_file->Value('THEME.STYLE');
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.huithemes_library.huitheme_class.inittheme', 'Unable to open theme configuration file ' . $this->mThemeFile, LOGGER_ERROR);
}
} else {
$this->mIconsSetName = $this->mUserSettings['iconsset'];
$this->mColorsSetName = $this->mUserSettings['colorsset'];
$this->mStyleName = $this->mUserSettings['stylename'];
}
$this->mIconsSetBase = CGI_URL . 'icons/' . $this->mIconsSetName . '/';
$this->mIconsBase = CGI_URL . 'icons/';
$this->mIconsSetDir = CGI_PATH . 'icons/' . $this->mIconsSetName . '/';
$this->mStyleBase = CGI_URL . 'styles/';
$this->mStyleDir = CGI_PATH . 'styles/' . $this->mStyleName . '/';
$hui_colors = new HuiColorsSet($this->mrAmpDb, $this->mColorsSetName);
$hui_icons = new HuiIconsSet($this->mrAmpDb, $this->mIconsSetName);
$hui_style = new HuiStyle($this->mrAmpDb, $this->mStyleName);
if ($amp->getState() != Ampoliros::STATE_SETUP) {
$cached_iconsset = new CachedItem($this->mrAmpDb, 'ampoliros', 'huiiconsset-' . $this->mIconsSetName);
$cached_colorsset = new CachedItem($this->mrAmpDb, 'ampoliros', 'huicolorsset-' . $this->mColorsSetName);
$cached_style = new CachedItem($this->mrAmpDb, 'ampoliros', 'huistyle-' . $this->mStyleName);
$this->mIconsSet = unserialize($cached_iconsset->Retrieve());
$this->mColorsSet = unserialize($cached_colorsset->Retrieve());
$this->mStyle = unserialize($cached_style->Retrieve());
}
if (!$this->mIconsSet or !$this->mColorsSet or !$this->mStyle) {
if ($gEnv['hui']['theme']['default'] == $this->mTheme) {
$this->mColorsSet = $hui_colors->GetColorsSet();
$this->mIconsSet = $hui_icons->GetIconsSet();
$this->mStyle = $hui_style->GetStyle();
} else {
OpenLibrary('configman.library');
$def_cfg_file = new ConfigFile(CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme');
if ($def_cfg_file->Opened()) {
$def_icons_set_name = $def_cfg_file->Value('THEME.ICONSSET');
$def_colors_set_name = $def_cfg_file->Value('THEME.COLORSSET');
$def_style_name = $def_cfg_file->Value('THEME.STYLE');
} else {
import('com.solarix.ampoliros.io.log.Logger');
$log = new Logger(AMP_LOG);
$log->LogEvent('ampoliros.huithemes_library.huitheme_class.inittheme', 'Unable to open default theme configuration file ' . CONFIG_PATH . $gEnv['hui']['theme']['default'] . '.huitheme', LOGGER_ERROR);
}
$hui_def_colors = new HuiColorsSet($this->mrAmpDb, $def_colors_set_name);
$hui_def_icons = new HuiIconsSet($this->mrAmpDb, $def_icons_set_name);
$hui_def_style = new HuiStyle($this->mrAmpDb, $def_style_name);
$this->mColorsSet = $this->DefOpts($hui_def_colors->GetColorsSet(), $hui_colors->GetColorsSet());
$this->mIconsSet = $this->DefOpts($hui_def_icons->GetIconsSet(), $hui_icons->GetIconsSet());
$this->mStyle = $this->DefOpts($hui_def_style->GetStyle(), $hui_style->GetStyle());
}
while (list($style_name, $style_item) = each($this->mStyle)) {
$this->mStyle[$style_name] = $this->mStyleBase . $style_item['base'] . '/' . $style_item['value'];
}
if ($amp->getState() != Ampoliros::STATE_SETUP) {
$cached_iconsset->Store(serialize($this->mIconsSet));
$cached_colorsset->Store(serialize($this->mColorsSet));
$cached_style->Store(serialize($this->mStyle));
}
}
}
return $result;
}