-
-
- file_put_contents($iniCacheTmp. '.links.ini', implode("\n", $out));
- if (file_exists($iniLinksCache)) {
- unlink($iniLinksCache);
+ $out_str = implode("\n", $out);
+ // is target file different?
+ if (!isset($replace[$iniLinksCache]) || $replace[$iniLinksCache] != md5($out)) {
+
+ file_put_contents($iniCacheTmp. '.links.ini', $out_str);
+ if (file_exists($iniLinksCache)) {
+ unlink($iniLinksCache);
+ }
+ rename($iniCacheTmp. '.links.ini', $iniLinksCache);
+ } else {
+ touch($iniLinksCache);
+