2012-03-28 09:41:42 -04:00
|
|
|
<?php
|
|
|
|
|
try {
|
2014-09-26 11:03:15 -04:00
|
|
|
$response = new stdClass;
|
2012-10-17 15:40:37 -04:00
|
|
|
if (isset( $_POST['javascriptCache'] ) || isset( $_POST['metadataCache'] ) || isset( $_POST['htmlCache'] )) {
|
2012-05-06 18:51:34 -04:00
|
|
|
|
2014-11-04 17:19:50 -04:00
|
|
|
$msgLog = "";
|
|
|
|
|
$msgLogAux = "";
|
|
|
|
|
|
|
|
|
|
if (isset($_POST["javascriptCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "ExtJs");
|
2012-10-17 15:40:37 -04:00
|
|
|
$response->javascript = true;
|
|
|
|
|
|
2014-11-04 17:19:50 -04:00
|
|
|
$msgLog = $msgLog . "Javascript Cache";
|
|
|
|
|
|
|
|
|
|
if (isset($_POST["metadataCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "xmlform");
|
|
|
|
|
$response->xmlform = true;
|
|
|
|
|
|
|
|
|
|
$msgLogAux = $msgLog;
|
|
|
|
|
$msgLog = $msgLog . ", Forms Metadata Cache";
|
|
|
|
|
|
|
|
|
|
if (isset($_POST["htmlCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "smarty");
|
|
|
|
|
$response->smarty = true;
|
|
|
|
|
|
|
|
|
|
$msgLog = $msgLog . " and Forms Html Templates Cache.";
|
|
|
|
|
} else {
|
|
|
|
|
$msgLog = $msgLogAux ." and Forms Metadata Cache.";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (isset($_POST["htmlCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "smarty");
|
|
|
|
|
$response->smarty = true;
|
|
|
|
|
|
|
|
|
|
$msgLog = $msgLog . " and Forms Html Templates Cache.";
|
|
|
|
|
} else {
|
|
|
|
|
$msgLog = $msgLog . ".";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (isset($_POST["metadataCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "xmlform");
|
|
|
|
|
$response->xmlform = true;
|
|
|
|
|
|
|
|
|
|
$msgLog = $msgLog . "Forms Metadata Cache";
|
|
|
|
|
|
|
|
|
|
if (isset($_POST["htmlCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "smarty");
|
|
|
|
|
$response->smarty = true;
|
|
|
|
|
|
|
|
|
|
$msgLog = $msgLog . " and Forms Html Templates Cache.";
|
|
|
|
|
} else {
|
|
|
|
|
$msgLog = $msgLog . ".";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (isset($_POST["htmlCache"])) {
|
|
|
|
|
G::rm_dir(PATH_C . "smarty");
|
|
|
|
|
$response->smarty = true;
|
2012-05-06 18:51:34 -04:00
|
|
|
|
2014-11-04 17:19:50 -04:00
|
|
|
$msgLog = $msgLog . "Forms Html Templates Cache.";
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-10-17 15:40:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$response->success = true;
|
2014-10-07 15:58:46 -04:00
|
|
|
|
|
|
|
|
G::auditLog("ClearCache", $msgLog);
|
2012-10-17 15:40:37 -04:00
|
|
|
} else {
|
|
|
|
|
$response->success = false;
|
2012-03-28 09:41:42 -04:00
|
|
|
}
|
2012-10-17 15:40:37 -04:00
|
|
|
} catch (Exception $e) {
|
2012-03-28 09:41:42 -04:00
|
|
|
$response->success = false;
|
2012-10-17 15:40:37 -04:00
|
|
|
$response->message = $e->getMessage();
|
2012-03-28 09:41:42 -04:00
|
|
|
}
|
2012-10-17 15:40:37 -04:00
|
|
|
echo G::json_encode( $response );
|
|
|
|
|
|