[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / inc / flock.php
index 9bdad6d..99e30b1 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2011                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -177,9 +177,13 @@ function ecrire_fichier ($fichier, $contenu, $ecrire_quand_meme = false, $trunca
                        spip_fclose_unlock($fp);
                }
 
                        spip_fclose_unlock($fp);
                }
 
-       // liberer le verrou et fermer le fichier
+               // liberer le verrou et fermer le fichier
                @chmod($fichier, _SPIP_CHMOD & 0666);
                @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;
+               }
        }
 
        include_spip('inc/autoriser');
        }
 
        include_spip('inc/autoriser');