From f816bd8b04db9ca63870a2a8f68ff8a8a261b9f0 Mon Sep 17 00:00:00 2001 From: divinity76 Date: Mon, 17 Mar 2025 14:58:12 +0100 Subject: [PATCH 1/2] 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. --- tinyfilemanager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index d1848d95..a9c7f12f 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -1639,8 +1639,6 @@ function getSelected($l) - - * . @@ -3691,7 +3689,11 @@ function save() 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); + } } } } From b2da712233a69fa66298533a96cf8591e949d05d Mon Sep 17 00:00:00 2001 From: divinity76 Date: Mon, 17 Mar 2025 15:00:31 +0100 Subject: [PATCH 2/2] needed this after all --- tinyfilemanager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index a9c7f12f..b971979f 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -570,6 +570,7 @@ function getClientIP() $theme = $te3; } $cfg->save(); + session_write_close(); echo true; }