added admin/crearCache

This commit is contained in:
Taras Machyshyn
2014-02-06 17:56:01 +02:00
parent 5a817ae61c
commit 1e29bc0f98
3 changed files with 252 additions and 216 deletions

View File

@@ -29,5 +29,19 @@ class Admin extends \Espo\Core\Controllers\Base
return json_encode($result);
}
public function actionClearCache($params, $data)
{
$cacheDir = $this->getContainer()->get('config')->get('cachePath');
$result = $this->getContainer()->get('fileManager')->removeInDir($cacheDir);
if ($result === false) {
throw new Error("Error while clearing cache");
}
return json_encode($result);
}
}