Location: PHPKode > projects > Php-Logging-System > phplogsys-1.1.4/includes/cache.php
<?php
//========================================================================
// BEGIN: GET THE INPUT VARIABLES
//========================================================================
$configTask = get_input('configTask');
//========================================================================
// END: GET THE INPUT VARIABLES
//========================================================================

//========================================================================
// BEGIN: HANDLE RELOAD CACHE REQUEST
//========================================================================
if(strcasecmp($configTask, 'reloadCache') == 0) {
	$reloadCache = TRUE;

	// Make sure caching is enabled
	if(!defined('USE_CACHE') || !USE_CACHE) {
		echo 'Caching of the search page is not enabled.';
		$reloadCache = FALSE;
	}

	// Make sure the cache table exists
	if(!table_exists(CACHETABLENAME, $dbLink)) {
		echo 'The cache table does not exist.';
		$reloadCache = FALSE;
	}

	// If conditions are OK then reload the cache
	if($reloadCache) {
		reload_cache($dbLink);
		echo 'The search cache has been updated.';
	}
}
//========================================================================
// END: HANDLE RELOAD CACHE REQUEST
//========================================================================

//========================================================================
// BEGIN: BUILDING THE HTML FORMS
//========================================================================
?>
<table class="pagecontent">
<tr><td>
<form action="<?=$_SERVER["PHP_SELF"]?>?pageId=cache" method="POST">
<input type="hidden" name="pageId" value="cache">
<input type="hidden" name="configTask" value="reloadCache">
<table><tr><td>
	<table class="searchform">
	<tr class="lighter"><td>
		<b>RELOAD SEARCH CACHE:</b>
		<table align="center" class="formentry">
		<tr><td>
		Reloading the cache may take a while if you have a lot of log data.
		</td></tr></table>
	</td></tr></table>
</td></tr>
	<table class="searchform">
	<tr><td class="darker">
	<input type="submit" value="Reload cache">
	</td></tr></table>
</td></tr></table>
</form>
</td></tr></table>
<?php
//========================================================================
// END: BUILDING THE HTML FORMS
//========================================================================
?>
Return current item: Php-Logging-System