[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,50 +321,39 @@ 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) if ($parsed_array === false)
{ {
$parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']); $parsed_array = array();
if ($parsed_array === false)
{
$parsed_array = array();
}
$reparse = false;
$filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
if (!file_exists($filename))
{
continue;
}
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
{
$reparse = true;
}
// Re-parse cfg file
if ($reparse)
{
$parsed_array = parse_cfg_file($filename);
$parsed_array['filetime'] = @filemtime($filename);
$this->driver->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array);
}
$parsed_items[$key] = $parsed_array;
} }
return $parsed_items; $reparse = false;
$filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
if (!file_exists($filename))
{
continue;
}
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
{
$reparse = true;
}
// Re-parse cfg file
if ($reparse)
{
$parsed_array = parse_cfg_file($filename);
$parsed_array['filetime'] = @filemtime($filename);
$this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
}
return $parsed_array;
} }
/** /**

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) ', '
); );