diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 13 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 29 | ||||
-rwxr-xr-x | phpBB/includes/mcp/mcp_logs.php | 2 | ||||
-rwxr-xr-x | phpBB/includes/mcp/mcp_notes.php | 7 | ||||
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 2 | ||||
-rwxr-xr-x | phpBB/includes/search/fulltext_native.php | 3 | ||||
-rw-r--r-- | phpBB/includes/session.php | 6 |
10 files changed, 38 insertions, 35 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 9de5d66b11..280ef4e395 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -6,6 +6,7 @@ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * +* @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc) */ /** diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 9defc15717..d5ee879df5 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -76,8 +76,6 @@ class acp_forums $auth->acl_clear_prefetch(); $cache->destroy('sql', FORUMS_TABLE); - recalc_btree('forum_id', FORUMS_TABLE); - trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); break; @@ -223,8 +221,6 @@ class acp_forums $auth->acl_clear_prefetch(); $cache->destroy('sql', FORUMS_TABLE); - recalc_btree('forum_id', FORUMS_TABLE); - $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id'] . '&select_all_groups=1'; // Redirect to permissions diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 592422f85e..02ca7bbb27 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -208,8 +208,6 @@ class acp_modules add_log('admin', 'LOG_MODULE_' . strtoupper($action), $move_module_name); - // recalculate binary tree - recalc_btree('module_id', MODULES_TABLE, $this->module_class); $this->remove_cache_file(); break; @@ -247,8 +245,6 @@ class acp_modules if (!sizeof($errors)) { - // recalculate binary tree - recalc_btree('module_id', MODULES_TABLE, $this->module_class); $this->remove_cache_file(); trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); @@ -337,8 +333,6 @@ class acp_modules if (!sizeof($errors)) { - // recalculate binary tree - recalc_btree('module_id', MODULES_TABLE, $this->module_class); $this->remove_cache_file(); trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bc33f96562..a63318e35f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2716,28 +2716,25 @@ function page_footer() // Tidy the cache $cron_type = 'tidy_cache'; } - else if (time() - $config['warnings_last_gc'] > $config['warnings_gc']) + else if (time() - $config['warnings_gc'] > $config['warnings_last_gc']) { $cron_type = 'tidy_warnings'; } - else if (time() - (7 * 24 * 3600) > $config['database_last_gc']) + else if (time() - $config['database_gc'] > $config['database_last_gc']) { - // Tidy some table rows every week + // Tidy the database + // This includes recalculation binary trees, ... $cron_type = 'tidy_database'; } - else if (time() - $config['search_last_gc'] > $config['search_gc']) + else if (time() - $config['search_gc'] > $config['search_last_gc']) { // Tidy the search $cron_type = 'tidy_search'; } -/** -* @todo add session garbage collection - else if (time() - $config['session_gc'] > $config['session_last_gc']) { $cron_type = 'tidy_sessions'; } -*/ if ($cron_type) { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2df3c37f9b..5751e39290 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -178,6 +178,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = $iteration++; } + $db->sql_freeresult($result); unset($padding_store); return $forum_list; @@ -2264,27 +2265,31 @@ function tidy_warnings() $db->sql_transaction('commit'); } - set_config('warnings_last_gc', time()); + set_config('warnings_last_gc', time(), true); } /** -* Tidy database -* Removes all tracking rows older than 6 months, including mark_posted informations +* Tidy database, doing some maintanance tasks */ function tidy_database() { global $db; -/* - $remove_date = time() - (3 * 62 * 24 * 3600); - $sql = 'DELETE FROM ' . FORUMS_TRACK_TABLE . ' - WHERE mark_time < ' . $remove_date; - $db->sql_query($sql); + // Recalculate binary tree for forums + recalc_btree('forum_id', FORUMS_TABLE); + + // Recalculate binary tree for modules + $sql = 'SELECT module_class + FROM ' . MODULES_TABLE . ' + GROUP BY module_class'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + recalc_btree('module_id', MODULES_TABLE, $row['module_class']); + } + $db->sql_freeresult($result); - $sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . ' - WHERE mark_time < ' . $remove_date; - $db->sql_query($sql); -*/ set_config('database_last_gc', time(), true); } diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index f77e65f003..36cb33b816 100755 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -28,6 +28,8 @@ class mcp_logs global $auth, $db, $user, $template; global $config, $phpbb_root_path, $phpEx, $SID; + $user->add_lang('acp/common'); + $action = request_var('action', array('' => '')); if (is_array($action)) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index b8280d4a9b..0bc6a28f3f 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -45,11 +45,14 @@ class mcp_notes ); $this->tpl_name = 'mcp_notes_front'; - break; + break; + case 'user_notes': + $user->add_lang('acp/common'); + mcp_notes_user_view($id, $mode, $action); $this->tpl_name = 'mcp_notes_user'; - break; + break; } } } diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 1fc21ffc8b..af44b98ded 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -615,6 +615,8 @@ class fulltext_mysql extends search_backend // destroy too old cached search results $this->destroy_cache(array()); + + set_config('search_last_gc', time(), true); } /** diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 48415ab409..52f56a0450 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -910,6 +910,7 @@ class fulltext_native extends search_backend // carry on ... it's okay ... I know when I'm not wanted boo hoo if (!$config['fulltext_native_load_upd']) { + set_config('search_last_gc', time(), true); return; } @@ -978,6 +979,8 @@ class fulltext_native extends search_backend // destroy cached search results containing any of the words that are now common or were removed $this->destroy_cache(array_unique($destroy_cache_words)); + + set_config('search_last_gc', time(), true); } /** diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 200c4e3227..306a7e36e1 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -270,12 +270,12 @@ class session $this->data = array(); - // Garbage collection ... remove old sessions updating user information + /* Garbage collection ... remove old sessions updating user information // if necessary. It means (potentially) 11 queries but only infrequently if ($this->time_now > $config['session_last_gc'] + $config['session_gc']) { $this->session_gc(); - } + }*/ // Do we allow autologin on this board? No? Then override anything // that may be requested here @@ -674,7 +674,7 @@ class session { // Less than 5 sessions, update gc timer ... else we want gc // called again to delete other sessions - set_config('session_last_gc', $this->time_now); + set_config('session_last_gc', $this->time_now, true); } break; } |