summaryrefslogtreecommitdiffstats
path: root/wp-inst/maintenance.php
blob: faef3f7dc523617627eae5d206ad04cfe7cd42ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/*
Call this file in a secure manner. You could set up a cron job to do it:
0 2,7,12,16,20 * * * (/usr/bin/lynx --dump http://localhost/maintenance.php) 2> /dev/null

You don't want others deleting your cache!
*/
die( 'You must delete line 2 of '.$_SERVER[ 'PHP_SELF' ].' for it to work!' ); // delete this line when you've secured this file.

if( $_SERVER[ 'REMOTE_ADDR' ] == '127.0.0.1' )
{
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*0" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*1" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*2" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*3" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*4" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*5" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*6" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*7" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*8" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*9" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*a" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*b" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*c" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*d" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*e" );
    exec( "rm -f ./wp-content/smarty-cache/function_cache/*f" );
}
?>