fix config save opcache delay

If you had opcache installed, settings changes would not be immediately applied, leading to the

>Sometimes the save action may not work on the first try, so please attempt it again.

text.

Opcache is bundled in php core as of php5.5.0, compiled by default in php-fpm, and is a very popular extension. It's basically ubiquitous.
This commit is contained in:
divinity76 2025-03-17 14:58:12 +01:00 committed by GitHub
commit f816bd8b04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1639,8 +1639,6 @@ if (isset($_GET['settings']) && !FM_READONLY) {
<button type="submit" class="btn btn-success"> <i class="fa fa-check-circle"></i> <?php echo lng('Save'); ?></button>
</div>
</div>
<small class="text-body-secondary">* <?php echo lng('Sometimes the save action may not work on the first try, so please attempt it again') ?>.</span>
</form>
</div>
</div>
@ -3691,7 +3689,11 @@ class FM_Config
for ($x = 3; $x < count($lines); $x++) {
@fputs($fh, $lines[$x], strlen($lines[$x]));
}
@fflush($fh);
@fclose($fh);
if (is_callable("opcache_invalidate")) {
@opcache_invalidate($fm_file, true);
}
}
}
}