Skip to content

Commit

Permalink
FIX include cache issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Algoud committed Mar 9, 2018
1 parent b68b66e commit 42aa7a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/modulebuilder/index.php
Expand Up @@ -490,8 +490,7 @@
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);

clearstatcache(true);
sleep(4); // With sleep 2, after the header("Location...", the new page output does not see the change. TODO Why do we need this sleep ?

// Make a redirect to reload all data
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.$module.'&tabobj='.$objectname.'&nocache='.time());

Expand Down Expand Up @@ -526,8 +525,7 @@
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);

clearstatcache(true);
sleep(4); // With sleep 2, after the header("Location...", the new page output does not see the change. TODO Why do we need this sleep ?

// Make a redirect to reload all data
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.$module.'&tabobj='.$objectname);

Expand Down Expand Up @@ -1550,6 +1548,8 @@

print '<br><br><br>';

opcache_invalidate($dirread.'/'.$pathtoclass,true); // remove the include cache hell !

if (empty($forceddirread))
{
$result = dol_include_once($pathtoclass);
Expand Down

0 comments on commit 42aa7a2

Please sign in to comment.