[ticket/10743] Changing obtain_cfg_items

Changing obtain_cfg_items to work only with style
because other components no longer exist

PHPBB3-10743
This commit is contained in:
Vjacheslav Trushkin 2012-04-02 11:45:26 +03:00 committed by Oleg Pudeyev
parent f22c99ffdb
commit 33b72ec62b
2 changed files with 26 additions and 40 deletions

View file

@ -321,19 +321,11 @@ class phpbb_cache_service
/** /**
* Obtain cfg file data * Obtain cfg file data
*/ */
function obtain_cfg_items($theme) function obtain_cfg_items($style)
{ {
global $config, $phpbb_root_path; global $config, $phpbb_root_path;
$parsed_items = array( $parsed_array = $this->driver->get('_cfg_' . $style['style_path']);
'theme' => array(),
'template' => array(),
'imageset' => array()
);
foreach ($parsed_items as $key => $parsed_array)
{
$parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
if ($parsed_array === false) if ($parsed_array === false)
{ {
@ -341,7 +333,7 @@ class phpbb_cache_service
} }
$reparse = false; $reparse = false;
$filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg'; $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
if (!file_exists($filename)) if (!file_exists($filename))
{ {
@ -359,12 +351,9 @@ class phpbb_cache_service
$parsed_array = parse_cfg_file($filename); $parsed_array = parse_cfg_file($filename);
$parsed_array['filetime'] = @filemtime($filename); $parsed_array['filetime'] = @filemtime($filename);
$this->driver->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array); $this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
} }
$parsed_items[$key] = $parsed_array; return $parsed_array;
}
return $parsed_items;
} }
/** /**

View file

@ -188,9 +188,6 @@ class phpbb_user extends phpbb_session
// Now parse the cfg file and cache it // Now parse the cfg file and cache it
$parsed_items = $cache->obtain_cfg_items($this->theme); $parsed_items = $cache->obtain_cfg_items($this->theme);
// We are only interested in the theme configuration for now
$parsed_items = $parsed_items['theme'];
$check_for = array( $check_for = array(
'pagination_sep' => (string) ', ' 'pagination_sep' => (string) ', '
); );