Browse Source

! OpCache caches Settings.php even when all prevailing conditions are that it should not.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
fcb4952ed2
2 changed files with 10 additions and 0 deletions
  1. 5 0
      Sources/Subs-Admin.php
  2. 5 0
      other/install.php

+ 5 - 0
Sources/Subs-Admin.php

@@ -392,6 +392,11 @@ function updateSettingsFile($config_vars)
 				@copy($boarddir . '/Settings_bak.php', $boarddir . '/Settings.php');
 		}
 	}
+
+	// Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
+	// it seems that there are times it might not. So let's MAKE it dump the cache.
+	if (function_exists('opcache_invalidate'))
+		opcache_invalidate($boarddir . '/Settings.php', true);
 }
 
 /**

+ 5 - 0
other/install.php

@@ -2020,6 +2020,11 @@ function updateSettingsFile($vars)
 	fwrite($fp, $settingsArray[$i] . '?' . '>');
 	fclose($fp);
 
+	// Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
+	// it seems that there are times it might not. So let's MAKE it dump the cache.
+	if (function_exists('opcache_invalidate'))
+		opcache_invalidate(dirname(__FILE__) . '/Settings.php', true);
+
 	return true;
 }