Merge "Added VirtualRESTServiceClient/VirtualRESTService classes"
[lhc/web/wiklou.git] / includes / cache / HTMLFileCache.php
index ab37911..91580f9 100644 (file)
@@ -31,8 +31,8 @@
 class HTMLFileCache extends FileCacheBase {
        /**
         * Construct an ObjectFileCache from a Title and an action
-        * @param $title Title|string Title object or prefixed DB key string
-        * @param $action string
+        * @param Title|string $title Title object or prefixed DB key string
+        * @param string $action
         * @throws MWException
         * @return HTMLFileCache
         */
@@ -84,7 +84,7 @@ class HTMLFileCache extends FileCacheBase {
 
        /**
         * Check if pages can be cached for this request/user
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return bool
         */
        public static function useFileCache( IContextSource $context ) {
@@ -94,6 +94,7 @@ class HTMLFileCache extends FileCacheBase {
                }
                if ( $wgShowIPinHeader || $wgDebugToolbar ) {
                        wfDebug( "HTML file cache skipped. Either \$wgShowIPinHeader and/or \$wgDebugToolbar on\n" );
+
                        return false;
                }
 
@@ -109,6 +110,7 @@ class HTMLFileCache extends FileCacheBase {
                        } elseif ( $query === 'maxage' || $query === 'smaxage' ) {
                                continue;
                        }
+
                        return false;
                }
                $user = $context->getUser();
@@ -116,13 +118,14 @@ class HTMLFileCache extends FileCacheBase {
                // and extensions for auto-detecting user language.
                $ulang = $context->getLanguage()->getCode();
                $clang = $wgContLang->getCode();
+
                // Check that there are no other sources of variation
                return !$user->getId() && !$user->getNewtalk() && $ulang == $clang;
        }
 
        /**
         * Read from cache to context output
-        * @param $context IContextSource
+        * @param IContextSource $context
         * @return void
         */
        public function loadFromFileCache( IContextSource $context ) {
@@ -152,7 +155,7 @@ class HTMLFileCache extends FileCacheBase {
        /**
         * Save this cache object with the given text.
         * Use this as an ob_start() handler.
-        * @param $text string
+        * @param string $text
         * @return bool Whether $wgUseFileCache is enabled
         */
        public function saveToFileCache( $text ) {
@@ -163,7 +166,7 @@ class HTMLFileCache extends FileCacheBase {
                        return $text;
                }
 
-               wfDebug( __METHOD__ . "()\n", false );
+               wfDebug( __METHOD__ . "()\n", 'log' );
 
                $now = wfTimestampNow();
                if ( $this->useGzip() ) {
@@ -185,6 +188,7 @@ class HTMLFileCache extends FileCacheBase {
                        // @todo Ugly wfClientAcceptsGzip() function - use context!
                        if ( wfClientAcceptsGzip() ) {
                                header( 'Content-Encoding: gzip' );
+
                                return $compressed;
                        } else {
                                return $text;
@@ -196,7 +200,7 @@ class HTMLFileCache extends FileCacheBase {
 
        /**
         * Clear the file caches for a page for all actions
-        * @param $title Title
+        * @param Title $title
         * @return bool Whether $wgUseFileCache is enabled
         */
        public static function clearFileCache( Title $title ) {