aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2012-04-02 11:45:26 +0300
committerOleg Pudeyev <oleg@bsdpower.com>2012-06-11 19:56:49 -0400
commit33b72ec62bd8b6e6c890e4c474d28389f048632a (patch)
tree6f49139709d8aef3e54feb3232f6155de6c53e89
parentMerge remote-tracking branch 'github-p/ticket/10882' into develop (diff)
downloadphpbb-33b72ec62bd8b6e6c890e4c474d28389f048632a.tar.gz
phpbb-33b72ec62bd8b6e6c890e4c474d28389f048632a.tar.bz2
phpbb-33b72ec62bd8b6e6c890e4c474d28389f048632a.zip
[ticket/10743] Changing obtain_cfg_items
Changing obtain_cfg_items to work only with style because other components no longer exist PHPBB3-10743
-rw-r--r--phpBB/includes/cache/service.php55
-rw-r--r--phpBB/includes/user.php3
2 files changed, 22 insertions, 36 deletions
diff --git a/phpBB/includes/cache/service.php b/phpBB/includes/cache/service.php
index aa225ade69..37f32aa753 100644
--- a/phpBB/includes/cache/service.php
+++ b/phpBB/includes/cache/service.php
@@ -321,50 +321,39 @@ class phpbb_cache_service
/**
* Obtain cfg file data
*/
- function obtain_cfg_items($theme)
+ function obtain_cfg_items($style)
{
global $config, $phpbb_root_path;
- $parsed_items = array(
- 'theme' => array(),
- 'template' => array(),
- 'imageset' => array()
- );
+ $parsed_array = $this->driver->get('_cfg_' . $style['style_path']);
- foreach ($parsed_items as $key => $parsed_array)
+ if ($parsed_array === false)
{
- $parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
-
- if ($parsed_array === false)
- {
- $parsed_array = array();
- }
+ $parsed_array = array();
+ }
- $reparse = false;
- $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
+ $reparse = false;
+ $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
- if (!file_exists($filename))
- {
- continue;
- }
+ if (!file_exists($filename))
+ {
+ continue;
+ }
- if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
- {
- $reparse = true;
- }
+ 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);
+ // 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;
+ $this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
}
-
- return $parsed_items;
+ return $parsed_array;
}
/**
diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php
index ce9c804f23..1db2364f76 100644
--- a/phpBB/includes/user.php
+++ b/phpBB/includes/user.php
@@ -188,9 +188,6 @@ class phpbb_user extends phpbb_session
// Now parse the cfg file and cache it
$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(
'pagination_sep' => (string) ', '
);