Fix up Configure extension logo setting handling:
[lhc/web/wiklou.git] / includes / HTMLFileCache.php
index a746681..ce064b6 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 /**
  * Contain the HTMLFileCache class
- * @addtogroup Cache
+ * @file
+ * @ingroup Cache
  */
 
 /**
  * emergency abort/fallback to cache.
  *
  * Global options that affect this module:
- * $wgCachePages
- * $wgCacheEpoch
- * $wgUseFileCache
- * $wgFileCacheDirectory
- * $wgUseGzip
+ * - $wgCachePages
+ * - $wgCacheEpoch
+ * - $wgUseFileCache
+ * - $wgFileCacheDirectory
+ * - $wgUseGzip
+ *
+ * @ingroup Cache
  */
 class HTMLFileCache {
        var $mTitle, $mFileCache;
 
        function HTMLFileCache( &$title ) {
                $this->mTitle =& $title;
-               $this->mFileCache = '';
+               $this->mFileCache = $this->fileCacheName();
        }
 
        function fileCacheName() {
@@ -111,13 +114,17 @@ class HTMLFileCache {
                $mydir2=substr($filename,0,strrpos($filename,'/')); # subdirectory level 2
                $mydir1=substr($mydir2,0,strrpos($mydir2,'/')); # subdirectory level 1
 
-               if(!file_exists($mydir1)) { mkdir($mydir1,0775); } # create if necessary
-               if(!file_exists($mydir2)) { mkdir($mydir2,0775); }
+               wfMkdirParents( $mydir1 );
+               wfMkdirParents( $mydir2 );
        }
 
        function saveToFileCache( $origtext ) {
+               global $wgUseFileCache;
+               if( !$wgUseFileCache ) {
+                       return $origtext; // return to output
+               }
                $text = $origtext;
-               if(strcmp($text,'') == 0) return '';
+               if( strcmp($text,'') == 0 ) return '';
 
                wfDebug(" saveToFileCache()\n", false);
 
@@ -153,5 +160,3 @@ class HTMLFileCache {
        }
 
 }
-
-