[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / ecrire / inc / flock.php
index b6c3677..bde1a53 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2012                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -178,9 +178,13 @@ function ecrire_fichier ($fichier, $contenu, $ignorer_echec = false, $truncate=t
                        spip_fclose_unlock($fp);
                }
 
-       // liberer le verrou et fermer le fichier
+               // liberer le verrou et fermer le fichier
                @chmod($fichier, _SPIP_CHMOD & 0666);
-               if ($ok) return $ok;
+               if ($ok) {
+                       if (!defined('_OPCACHE_BUG') AND function_exists('opcache_invalidate'))
+                               opcache_invalidate($fichier, true);
+                       return $ok;
+               }
        }
 
        if (!$ignorer_echec){