X-Git-Url: http://git.roojs.org/?p=pear;a=blobdiff_plain;f=HTML%2FFlexyFramework%2FGenerator.php;fp=HTML%2FFlexyFramework%2FGenerator.php;h=1c092effc0811ded877e835e5412122ee4acfba8;hp=8f86a0f58a2fb53f1b16a3750806ef47a813bcbd;hb=cd69e97b71167c94f331195574722949c63ed01b;hpb=ab93913e84993dead1d9c9129fefc1f954b0b23b diff --git a/HTML/FlexyFramework/Generator.php b/HTML/FlexyFramework/Generator.php index 8f86a0f5..1c092eff 100644 --- a/HTML/FlexyFramework/Generator.php +++ b/HTML/FlexyFramework/Generator.php @@ -186,8 +186,20 @@ class HTML_FlexyFramework_Generator extends DB_DataObject_Generator clearstatcache(); if (file_exists($iniCacheTmp) && filesize($iniCacheTmp)) { // is the replace file exist? - if (!isset($replace[$iniCache]) || $replace[$iniCache] != md5_file($iniCacheTmp)) { + if (isset($replace[$iniCache]) && $replace[$iniCache] != md5_file($iniCacheTmp)) { + // file has changed. + // it seems to happen that in this case if there are less elements in the file than before, then we might have an error + // it's better to just die here, than continue. + $old = parse_ini_file($iniCache,true); + $new = parse_ini_file($iniCacheTmp,true); + if (count(array_keys($new)) < count(array_keys($old))) { + die("Generated INI file failed, try reloading"); + } + } + + if (!isset($replace[$iniCache]) || $replace[$iniCache] != md5_file($iniCacheTmp)) { + if (file_exists($iniCache)) { unlink($iniCache);