From cb81edc195adc52dbb5216919b5b85ad5e92e459 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 25 Jun 2005 13:39:19 +0000 Subject: [PATCH] faster read-only mode --- includes/GlobalFunctions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9dd3d1e2d5..d050072a32 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -224,7 +224,15 @@ function wfReadOnly() { if ( '' == $wgReadOnlyFile ) { return false; } - return is_file( $wgReadOnlyFile ); + + // Set $wgReadOnly and unset $wgReadOnlyFile, for faster access next time + if ( is_file( $wgReadOnlyFile ) ) { + $wgReadOnly = true; + } else { + $wgReadOnly = false; + } + $wgReadOnlyFile = ''; + return $wgReadOnly; } -- 2.20.1