faster read-only mode
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 25 Jun 2005 13:39:19 +0000 (13:39 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 25 Jun 2005 13:39:19 +0000 (13:39 +0000)
includes/GlobalFunctions.php

index 9dd3d1e..d050072 100644 (file)
@@ -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;
 }