Subversion Repositories bysoftdeveloper

[/] [modules/] [bysoftdeveloper/] [clearcache.php] - Blame information for rev 32

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 cavin.deng
<?php
2
 
3
$bysoftDevINI = eZINI::instance('bysoftdeveloper.ini');
4
 
5
$phpBinaryPath = $bysoftDevINI->variable('BysoftDeveloper', 'PHPBinaryPath');
6
 
7
exec($phpBinaryPath . ' -v', $return);
8
 
9
if (strpos($return[0], 'PHP') === false) {
10 18 cavin.deng
        echo "\"$phpBinaryPath\" isn't PHP CLI, please change it in bysoftdeveloper.ini";
11 17 cavin.deng
} else {
12 32 alvawu
        $cleanCacheCommand = $phpBinaryPath . ' bin/php/ezcache.php --clear-all --no-colors --purge';
13 17 cavin.deng
        exec($cleanCacheCommand, $output, $status);
14
        if ($status == 0) {
15
                echo 'Clear Cache Done!';
16
        }
17
}
18
 
19
eZExecution::cleanExit();
20
 
21
?>