mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* Implementation of ClearCache controller
|
||
|
*
|
||
|
* @category DMS
|
||
|
* @package SeedDMS
|
||
|
* @license GPL 2
|
||
|
* @version @version@
|
||
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||
|
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
|
||
|
* @version Release: @package_version@
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Class which does the busines logic for clearing the cache
|
||
|
*
|
||
|
* @category DMS
|
||
|
* @package SeedDMS
|
||
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||
|
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
|
||
|
* @version Release: @package_version@
|
||
|
*/
|
||
|
class SeedDMS_Controller_ClearCache extends SeedDMS_Controller_Common {
|
||
|
|
||
|
public function run() {
|
||
|
$dms = $this->params['dms'];
|
||
|
$user = $this->params['user'];
|
||
|
$settings = $this->params['settings'];
|
||
|
$post = $this->params['post'];
|
||
|
|
||
|
$ret = '';
|
||
|
if(!empty($post['preview'])) {
|
||
|
$cmd = 'rm -rf '.$settings->_cacheDir.'/[1-9]*';
|
||
|
system($cmd, $ret);
|
||
|
}
|
||
|
|
||
|
if(!empty($post['js'])) {
|
||
|
$cmd = 'rm -rf '.$settings->_cacheDir.'/js/*';
|
||
|
system($cmd, $ret);
|
||
|
}
|
||
|
|
||
|
if(false === $this->callHook('clear', $post)) {
|
||
|
if(empty($this->errormsg))
|
||
|
$this->errormsg = 'hook_clear_failed';
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|