1
wishcraft
Drop the cache - Quickly

Here is a bit of code you can put in an HTML page to drop the cache quickly, very simple. Your Code View::
<?php
    
echo '<ul><li>ok</li>';
    
error_reporting(E_ALL);
    echo 
'<li>Error Checking on - ok<li>';    
    
define('XOOPS_VAR_PATH''/home/../../xoops_data');
    echo 
'<li>Path Set - '.XOOPS_VAR_PATH.'</li>';    
    
$start[0] = time();
    
$length[0] = 60*4;
    
set_time_limit($length[0]);
    echo 
'<li>Step Smarty Cache Clear Started</li>';
    
unlinkRecursive(XOOPS_VAR_PATH.'/caches/smarty_cache'false);
    echo 
'<li>Step Smarty Cache Clear Ended</li>';
    
$start[1] = time();
    
$length[1] += $start[1] - $length[0];
    
set_time_limit($length[1]);
    echo 
'<li>Step Smarty Compile Clear Started</li>';
    
unlinkRecursive(XOOPS_VAR_PATH.'/caches/smarty_compile'false);
    echo 
'<li>Step Smarty Compile Clear Ended</li>';
    
$start[2] = time();
    
$length[2] += $start[2] - $length[1];
    
set_time_limit($length[2]);
    echo 
'<li>Step XOOPS Cache Started</li>';
    
unlinkRecursive(XOOPS_VAR_PATH.'/caches/xoops_cache'false);
    
$end time();
    echo 
'<li>Step XOOPS Cache Ended</li></ul>';

    exit(
0);

/**
 * Recursively delete a directory
 *
 * @param string $dir Directory name
 * @param boolean $deleteRootToo Delete specified top-level directory as well
 */
function unlinkRecursive($dir$deleteRootToo)
{
    if(!
$dh = @opendir($dir))
    {
        return;
    }
    while (
false !== ($obj readdir($dh)))
    {
        if(
$obj == '.' || $obj == '..')
        {
            continue;
        }

        if (!@
unlink($dir '/' $obj))
        {
            
unlinkRecursive($dir.'/'.$objtrue);
        }
    }

    
closedir($dh);
   
    if (
$deleteRootToo)
    {
        @
rmdir($dir);
    }
   
    return;
}
?>

2
DonCurioso
Re: Drop the cache - Quickly

Hi Wishcraft,

you can find this hack to have a direct link into administration, called xDelCache.

Basically, do the same.

Regards

3
wishcraft
Re: Drop the cache - Quickly

To Don,

How are you? You will notice in most cache cleaning in XOOPS as smarty is always instantiated on XOOPS I have not found any form of clear step to completely clearing a cache including shadow files, for example other internets that use your computer like .int, .mil, .sse and so on all have a 'different' internet, so when you are sitting on this one you only see the files we use.

To clear the cache completely that is the best method, as if you have XOOPS attached it will only clear top layer files.

Thanks

Simon

Login

Who's Online

173 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits