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::
    echo '
  • ok
  • ';
        
    error_reporting(E_ALL);
        echo 
    '
  • Error Checking on - ok
  • ';    
        
    define('XOOPS_VAR_PATH''/home/../../xoops_data');
        echo 
    '
  • Path Set - '.XOOPS_VAR_PATH.'
  • '
    ;    
        
    $start[0] = time();
        
    $length[0] = 60*4;
        
    set_time_limit($length[0]);
        echo 
    '
  • Step Smarty Cache Clear Started
  • '
    ;
        
    unlinkRecursive(XOOPS_VAR_PATH.'/caches/smarty_cache'false);
        echo 
    '
  • Step Smarty Cache Clear Ended
  • '
    ;
        
    $start[1] = time();
        
    $length[1] += $start[1] - $length[0];
        
    set_time_limit($length[1]);
        echo 
    '
  • Step Smarty Compile Clear Started
  • '
    ;
        
    unlinkRecursive(XOOPS_VAR_PATH.'/caches/smarty_compile'false);
        echo 
    '
  • Step Smarty Compile Clear Ended
  • '
    ;
        
    $start[2] = time();
        
    $length[2] += $start[2] - $length[1];
        
    set_time_limit($length[2]);
        echo 
    '
  • Step XOOPS Cache Started
  • '
    ;
        
    unlinkRecursive(XOOPS_VAR_PATH.'/caches/xoops_cache'false);
        
    $end time();
        echo 
    '
  • Step XOOPS Cache Ended
'
;

    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

311 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 311


more...

Donat-O-Meter

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

Latest GitHub Commits