本文整理汇总了PHP中SPLoader::iniStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP SPLoader::iniStorage方法的具体用法?PHP SPLoader::iniStorage怎么用?PHP SPLoader::iniStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPLoader
的用法示例。
在下文中一共展示了SPLoader::iniStorage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tplCfg
/**
*/
protected function tplCfg($path, $task = null)
{
$file = explode('.', $path);
$files = array();
if (strstr($file[0], 'cms:')) {
$file[0] = str_replace('cms:', null, $file[0]);
$file = SPFactory::mainframe()->path(implode('.', $file));
$path = SPLoader::dirPath($file, 'root', true);
$this->_tCfg = SPLoader::loadIniFile("{$path}.config", true, false, false, true);
$files[] = SPLoader::iniStorage();
} else {
$this->_tCfg = SPLoader::loadIniFile("usr.templates.{$path}.config");
$files[] = SPLoader::iniStorage();
$path = SPLoader::dirPath('usr.templates.' . $path, 'front', true);
}
if (!$task) {
$task = $this->_task == 'add' || $this->_task == 'submit' ? 'edit' : $this->template;
}
if (SPLoader::translatePath("{$path}.{$this->templateType}.{$task}", 'absolute', true, 'ini')) {
$taskCfg = SPLoader::loadIniFile("{$path}.{$this->templateType}.{$task}", true, false, false, true);
$files[] = SPLoader::iniStorage();
foreach ($taskCfg as $section => $keys) {
if (isset($this->_tCfg[$section])) {
$this->_tCfg[$section] = array_merge($this->_tCfg[$section], $keys);
} else {
$this->_tCfg[$section] = $keys;
}
}
}
if (count($files)) {
foreach ($files as $i => $file) {
$files[$i] = array('file' => str_replace(SPLoader::translateDirPath(Sobi::Cfg('section.template'), 'templates'), null, $file), 'checksum' => md5_file($file));
}
SPFactory::registry()->set('template_config', $files);
}
if (SPLoader::translatePath("{$path}.config", 'absolute', true, 'json')) {
$config = json_decode(SPFs::read(SPLoader::translatePath("{$path}.config", 'absolute', true, 'json')), true);
$settings = array();
foreach ($config as $section => $setting) {
$settings[str_replace('-', '.', $section)] = $setting;
}
if (SPLoader::translatePath("{$path}.{$this->templateType}.{$task}", 'absolute', true, 'json')) {
$subConfig = json_decode(SPFs::read(SPLoader::translatePath("{$path}.{$this->templateType}.{$task}", 'absolute', true, 'json')), true);
if (count($subConfig)) {
foreach ($subConfig as $section => $subSettings) {
foreach ($subSettings as $k => $v) {
$settings[str_replace('-', '.', $section)][$k] = $v;
}
}
}
}
if (isset($settings['general'])) {
foreach ($settings['general'] as $k => $v) {
$this->_tCfg['general'][$k] = $v;
}
}
$task = SPRequest::task() == 'entry.add' ? 'entry.edit' : SPRequest::task();
if (isset($settings[$task])) {
foreach ($settings[$task] as $k => $v) {
$this->_tCfg['general'][$k] = $v;
}
}
}
Sobi::Trigger($this->name(), __FUNCTION__, array(&$this->_tCfg));
SPFactory::registry()->set('current_template', $path);
}