Skip to content
Snippets Groups Projects
Commit 96b8339d authored by Regis Houssin's avatar Regis Houssin Committed by Laurent Destailleur
Browse files

Fix: [Restler] Delete the cache file otherwise it does not update

parent d2813eab
No related branches found
No related tags found
No related merge requests found
...@@ -42,13 +42,30 @@ if ($action == 'setproductionmode') ...@@ -42,13 +42,30 @@ if ($action == 'setproductionmode')
$status = GETPOST('status','alpha'); $status = GETPOST('status','alpha');
if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0) if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0)
{
$error=0;
if ($status == 1)
{ {
$result = dol_mkdir($conf->api->dir_temp); $result = dol_mkdir($conf->api->dir_temp);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($langs->trans("ErrorFaildToCreateDir", $conf->api->dir_temp), null, 'errors'); setEventMessages($langs->trans("ErrorFailedToCreateDir", $conf->api->dir_temp), null, 'errors');
$error++;
}
} }
else else
{
// Delete the cache file otherwise it does not update
$result = dol_delete_file($conf->api->dir_temp.'/routes.php');
if ($result < 0)
{
setEventMessages($langs->trans("ErrorFailedToDeleteFile", $conf->api->dir_temp.'/routes.php'), null, 'errors');
$error++;
}
}
if (!$error)
{ {
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment