From: Tim Starling Date: Sat, 25 Jun 2005 13:39:19 +0000 (+0000) Subject: faster read-only mode X-Git-Tag: 1.5.0beta1~31 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=cb81edc195adc52dbb5216919b5b85ad5e92e459;p=lhc%2Fweb%2Fwiklou.git faster read-only mode --- 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; }