aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_update.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-01 16:09:50 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-01 16:09:50 +0000
commit6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2 (patch)
tree9a369d5bda1449ab2218979181bcf219096c52ac /phpBB/install/install_update.php
parent817a82a1afb86a1761c5c6a810ed9b8f599c147a (diff)
downloadforums-6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2.tar
forums-6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2.tar.gz
forums-6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2.tar.bz2
forums-6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2.tar.xz
forums-6ca11b2d2b7a9e6420eec3b21e1531c1586c15c2.zip
some fixes... most importantly the ability to update the board with the automatic files while having fsockopen disabled (instead, the update file information will be used, which may be inaccurate if the admin did a mistake).
git-svn-id: file:///svn/phpbb/trunk@7818 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install/install_update.php')
-rw-r--r--phpBB/install/install_update.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 5c83ac2c67..e6fdddf0a2 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -408,6 +408,60 @@ class install_update extends module
// Add database update to log
add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->latest_version);
+ // Refresh prosilver css data - this may cause some unhappy users, but
+ $sql = 'SELECT *
+ FROM ' . STYLES_THEME_TABLE . "
+ WHERE theme_name = 'prosilver'";
+ $result = $db->sql_query($sql);
+ $theme = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($theme)
+ {
+ $recache = (empty($theme['theme_data'])) ? true : false;
+ $update_time = time();
+
+ // We test for stylesheet.css because it is faster and most likely the only file changed on common themes
+ if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
+ {
+ $recache = true;
+ $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
+ }
+ else if (!$recache)
+ {
+ $last_change = $theme['theme_mtime'];
+
+ foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file)
+ {
+ if ($last_change < @filemtime($file))
+ {
+ $recache = true;
+ break;
+ }
+ }
+ }
+
+ if ($recache)
+ {
+ include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
+
+ $theme['theme_data'] = acp_styles::db_theme_data($theme);
+ $theme['theme_mtime'] = $update_time;
+
+ // Save CSS contents
+ $sql_ary = array(
+ 'theme_mtime' => $theme['theme_mtime'],
+ 'theme_data' => $theme['theme_data']
+ );
+
+ $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE theme_id = ' . $theme['theme_id'];
+ $db->sql_query($sql);
+
+ $cache->destroy('sql', STYLES_THEME_TABLE);
+ }
+ }
+
$cache->purge();
$db->sql_return_on_error(true);
@@ -1192,6 +1246,19 @@ class install_update extends module
{
$info = $this->test_update;
}
+
+ // If info is false the fsockopen function may not be working. Instead get the latest version from our update file (and pray it is up-to-date)
+ if ($info === false)
+ {
+ $update_info = array();
+ include($phpbb_root_path . 'install/update/index.php');
+ $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
+
+ if ($info !== false)
+ {
+ $info = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false;
+ }
+ }
break;
case 'update_info':