Go to the documentation of this file.
43 if ( !in_array( $action, $allowedTypes ) ) {
44 throw new MWException(
"Invalid filecache type given." );
47 ?
$title->getPrefixedDBkey()
49 $cache->mType = (string)$action;
60 return array(
'view',
'history' );
78 if ( $this->mType ===
'view' ) {
81 return $this->mType .
'/';
92 if ( !$wgUseFileCache ) {
95 if ( $wgShowIPinHeader || $wgDebugToolbar ) {
96 wfDebug(
"HTML file cache skipped. Either \$wgShowIPinHeader and/or \$wgDebugToolbar on\n" );
102 $queryVals = $context->
getRequest()->getValues();
103 foreach ( $queryVals
as $query => $val ) {
107 } elseif (
$query ===
'action' && in_array( $val, self::cacheablePageActions() ) ) {
110 } elseif (
$query ===
'maxage' ||
$query ===
'smaxage' ) {
123 return !
$user->getId() && !
$user->getNewtalk() && $ulang == $clang;
132 global $wgMimeType, $wgLanguageCode;
134 wfDebug( __METHOD__ .
"()\n" );
137 $context->
getOutput()->sendCacheControl();
138 header(
"Content-Type: $wgMimeType; charset=UTF-8" );
139 header(
"Content-Language: $wgLanguageCode" );
142 header(
'Content-Encoding: gzip' );
143 readfile( $filename );
146 wfDebug( __METHOD__ .
" uncompressing cache file and sending it\n" );
147 readgzfile( $filename );
150 readfile( $filename );
164 if ( !$wgUseFileCache || strlen( $text ) < 512 ) {
169 wfDebug( __METHOD__ .
"()\n",
'log' );
174 '</html>',
'<!-- Cached/compressed ' . $now .
" -->\n</html>", $text );
177 '</html>',
'<!-- Cached ' . $now .
" -->\n</html>", $text );
181 $compressed = $this->
saveText( $text );
182 if ( $compressed ===
false ) {
190 header(
'Content-Encoding: gzip' );
209 if ( !$wgUseFileCache ) {
213 foreach ( self::cacheablePageActions()
as $type ) {
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
saveText( $text)
Save and compress text to the cache.
static clearFileCache(Title $title)
Clear the file caches for a page for all actions.
Page view caching in the file system.
typeSubdirectory()
Get the cache type subdirectory (with the trailing slash) or the empty string Alter the type -> direc...
static cacheablePageActions()
Cacheable actions.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
saveToFileCache( $text)
Save this cache object with the given text.
loadFromFileCache(IContextSource $context)
Read from cache to context output.
static useFileCache(IContextSource $context)
Check if pages can be cached for this request/user.
useGzip()
Check if the cache is gzipped.
baseCacheDirectory()
Get the base file cache directory.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
presenting them properly to the user as errors is done by the caller $title
wfClientAcceptsGzip( $force=false)
static newFromTitle( $title, $action)
Construct an ObjectFileCache from a Title and an action.
getUser()
Get the User object.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Interface for objects which can provide a context on request.
Represents a title within MediaWiki.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
cachePath()
Get the path to the cache file.
getRequest()
Get the WebRequest object.
cacheDirectory()
Get the base file cache directory.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
getOutput()
Get the OutputPage object.
getLanguage()
Get the Language object.
Base class for data storage in the file system.