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
*/
/**
* Check if pages can be cached for this request/user
- * @param $context IContextSource
+ * @param IContextSource $context
* @return bool
*/
public static function useFileCache( IContextSource $context ) {
}
if ( $wgShowIPinHeader || $wgDebugToolbar ) {
wfDebug( "HTML file cache skipped. Either \$wgShowIPinHeader and/or \$wgDebugToolbar on\n" );
+
return false;
}
} elseif ( $query === 'maxage' || $query === 'smaxage' ) {
continue;
}
+
return false;
}
$user = $context->getUser();
// 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 ) {
/**
* 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 ) {
return $text;
}
- wfDebug( __METHOD__ . "()\n", false );
+ wfDebug( __METHOD__ . "()\n", 'log' );
$now = wfTimestampNow();
if ( $this->useGzip() ) {
// @todo Ugly wfClientAcceptsGzip() function - use context!
if ( wfClientAcceptsGzip() ) {
header( 'Content-Encoding: gzip' );
+
return $compressed;
} else {
return $text;
/**
* 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 ) {