Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-4325

No ability to completely clear the cache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.0
    • 3.0.x
    • ACP
    • None
    • PHP Environment:
      Database:

      In phpBB3, we have the ability to clear any cache related to the styles (template, theme, imageset data etc), but we don’t have the ability to clear any other cache info, such as SQL queries, ACP style info, etc...

      Here is a simple Patch file for the ACP Main that will get the job done.
      (in-post and attached)

      *** /phpBB2/adm/style/acp_main.html	Sat May 12 19:00:37 2007
      --- /phpBB3/adm/style/acp_main.html	Tue May 15 20:54:36 2007
      ***************
      *** 126,131 ****
      --- 126,138 ----
        					<dd><input type="hidden" name="action" value="db_track" /><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd>
        				</dl>
        			</form>
      + 			
      + 			<form id="action_purge_cache_form" method="post" action="{U_ACTION}">
      + 				<dl>
      + 					<dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
      + 					<dd><input type="hidden" name="action" value="cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
      + 				</dl>
      + 			</form>
        		</fieldset>
        	<!-- ENDIF -->
       
      *** /phpBB2/includes/acp/acp_main.php	Sun Mar  4 14:30:39 2007
      --- /phpBB3/includes/acp/acp_main.php	Tue May 15 21:02:14 2007
      ***************
      *** 17,23 ****
       
        	function main($id, $mode)
        	{
      ! 		global $config, $db, $user, $auth, $template;
        		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
       
        		// Show restore permissions notice
      --- 17,23 ----
       
        	function main($id, $mode)
        	{
      ! 		global $config, $db, $user, $auth, $template, $cache;
        		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
       
        		// Show restore permissions notice
      ***************
      *** 77,82 ****
      --- 77,86 ----
        						$confirm = true;
        						$confirm_lang = 'RESYNC_POST_MARKING_CONFIRM';
        					break;
      + 					case 'purge_cache':
      + 						$confim = true;
      + 						$confirm_lang = 'PURGE_CACHE_CONFIRM';
      + 					break;
       
        					default:
        						$confirm = true;
      ***************
      *** 257,262 ****
      --- 261,276 ----
       
        						add_log('admin', 'LOG_RESYNC_POST_MARKING');
        					break;
      + 					
      + 					case 'purge_cache':
      + 						if (!$auth->acl_get('a_board'))
      + 						{
      + 							trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
      + 						}
      + 						
      + 						$cache->purge();
      + 						add_log('admin', 'LOG_PURGE_CACHE');
      + 					break;
        				}
        			}
        		}
       
      *** /phpBB2/language/en/acp/common.php	Tue May 15 21:16:11 2007
      --- /phpBB3/language/en/acp/common.php	Tue May 15 21:16:02 2007
      ***************
      *** 318,324 ****
        	'NUMBER_USERS'		=> 'Number of users',
        	'NUMBER_ORPHAN'		=> 'Orphan attachments',
       
      ! 	'POSTS_PER_DAY'		=> 'Posts per day',
       
        	'RESET_DATE'					=> 'Reset board’s start date',
        	'RESET_DATE_CONFIRM'			=> 'Are you sure you wish to reset the board’s start date?',
      --- 318,327 ----
        	'NUMBER_USERS'		=> 'Number of users',
        	'NUMBER_ORPHAN'		=> 'Orphan attachments',
       
      ! 	'POSTS_PER_DAY'			=> 'Posts per day',
      ! 	'PURGE_CACHE'			=> 'Purge the cache',
      ! 	'PURGE_CACHE_CONFIRM'	=> 'Are you sure you want to purge the cache?',
      ! 	'PURGE_CACHE_EXPLAIN'	=> 'Purge the board cache including template and SQL data',
       
        	'RESET_DATE'					=> 'Reset board’s start date',
        	'RESET_DATE_CONFIRM'			=> 'Are you sure you wish to reset the board’s start date?',
      ***************
      *** 466,471 ****
      --- 469,475 ----
        	'LOG_POST_APPROVED'			=> '<strong>Approved post</strong><br />» %s',
        	'LOG_POST_DISAPPROVED'		=> '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
        	'LOG_POST_EDITED'			=> '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
      + 	'LOG_PURGE_CACHE'			=> '<strong>Cache purged</strong><br />» %s',
        	'LOG_REPORT_CLOSED'			=> '<strong>Closed report</strong><br />» %s',
        	'LOG_REPORT_DELETED'		=> '<strong>Deleted report</strong><br />» %s',
        	'LOG_SPLIT_DESTINATION'		=> '<strong>Moved splitted posts</strong><br />» to %s',

            DavidMJ DavidMJ
            Highway of Life David Lewis [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: