Commit graph

42 commits

Author SHA1 Message Date
Seb35
ad0d70fd52 $wgUseGzip had no effect
Since MediaWiki 1.24 a constructor is defined in HTMLFileCache,
so the constructor of the parent class, FileCacheBase, is no more
called, and $wgUseGzip is no more used. This fix explicitely calls
the parent constructor.

Bug: T103237
Change-Id: I80c1871881049b9618c23aa76e6665867ecec2aa
2015-06-20 19:07:07 +02:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
jenkins-bot
fca90adbd7 Merge "Deprecate HTMLFileCache::newFromTitle() in favor of constructor" 2014-09-19 00:24:16 +00:00
Max Semenik
0fddd42ca4 Deprecate HTMLFileCache::newFromTitle() in favor of constructor
Change-Id: I903e68fc1f486501d790ca69146ecb835d90c9cc
2014-09-19 00:07:51 +00:00
Max Semenik
bbc92a1433 Add a hook to allow extensions to prevent HTML file caching
Needed for MobileFrontend on third-party sites that use this feature.
Ideally, there should be a way to cache mobile requests too, but that's
a different issue requiring much more effort to do properly.

Bug: 68106
Change-Id: I01a76c571d9186b325f19a00cec136459707c791
2014-09-18 17:00:39 -07:00
umherirrender
fd66273c94 Fixed some @params documentation (includes/[cache|objectcache])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I86fd10e3f2d4bb80e7432533038d124693acfb3c
2014-04-19 01:19:46 +02:00
Alexandre Emsenhuber
a7a0883019 Enhance the destination control parameter of wfDebug() and wfDebugLog()
- The parameter is now a string, making is more understandable than
  boolean values
- It takes the same values in both wfDebug() and wfDebugLog() (except
  for 'private' which is only used in the latter)
- This adds a new possibility to wfDebugLog() to log the message either
  on the specific log or the general one, but not to the debug toolbar
- Old boolean values are still recognised for backward compatibility
- Also send the messages passed to wfDebugLog() to the debug toolbar
  when they are written to a specific log and not restricted to logs
- Updated the calls of and wfDebug() and wfDebugLog() with the last
  parameter to change it into a string
- Renamed MWDebug::sendWarning() to MWDebug::sendMessage() and added
  $group parameter to it; will not break anything since that method
  is marked as private
- Changed the call to wfDebug() from MWDebug::sendMessage() to use
  wfDebugLog() with 'log' as thrid parameter, so that those messages
  can be logged separately from the main log and they don't show up
  a second time on the "debug log" tab of the debug toolbar

Change-Id: I1be09d4c1d3408ed5b26a5db02691c17c0ec0926
2014-02-04 19:56:24 +00:00
Siebrand Mazeland
8251479984 Update formatting
Change-Id: I9aa56cbe0989d6f302ee0f47c4a6154101f73e90
2013-11-17 21:46:55 +01:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Alexandre Emsenhuber
18786f4bdd Make HTMLFileCache also work when gzip is not enabled server-side.
In that case, it was just returning a blank page.

Change-Id: I08fbc5be37b5ee31504aae6af51b6cbebef44f29
2012-06-26 12:44:36 +02:00
Alexandre Emsenhuber
4471b93253 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I604ed8ddc572e89001e49df6740ab42307bc0330
2012-05-08 14:51:21 +02:00
Aaron Schulz
18df3d63bd Made loadFromFileCache() always disable $wgOut regardless of whether compression is used 2012-02-09 18:53:35 +00:00
Antoine Musso
9b6a4c922a debug statements for HTMLFileCache / Output 2012-02-09 10:56:36 +00:00
Antoine Musso
1cb1abe773 add up comment for FileCache rewrite (r98698) 2012-02-07 17:56:32 +00:00
Alexandre Emsenhuber
34789d1c85 Follow-up r110761: removed duplicate check of $wgShowIPinHeader and fix some whitespaces 2012-02-06 21:52:48 +00:00
Antoine Musso
57e874c374 disable wgDebugToolbar when rebuilding file cache
credits to iAlex :)
2012-02-06 17:17:51 +00:00
Alexandre Emsenhuber
64aff97567 Removed false comment, we no longer use file cache for action=raw calls. 2012-02-06 11:35:24 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Aaron Schulz
5214c4f073 * Let HTMLFileCache constructor take in a Title *or* a the prefixed dbkey itself.
* Tweaked filecache fallback in fileCachedPage() to try the raw title param. If the DB is down, we can get most views of titles with colons in them to work this way. Previously, it could fail on an interwiki lookup.
2011-11-02 20:01:22 +00:00
Aaron Schulz
119ee2a872 Simplified cacheDirectory() in FileCacheBase and HTMLFileCache. It turns out $wgFileCacheDirectory is always set in setup.php already. 2011-10-03 06:54:39 +00:00
Aaron Schulz
1ba93d9b77 * Added isCacheWorthy() optimization (checks if the file exists, stale or not)
* Made isCached() use process cache
* Added MISS_TTL_SEC constant and tweaked MISS_FACTOR constant
2011-10-02 19:44:31 +00:00
Aaron Schulz
93d358cd0c FileCache:
* Added FileCacheBase::*MissesRecent() functions for counting cache misses from different visitors.
* Made ObjectFileCache more generic.
* Cleaned up FileCacheBase::checkCacheDirs().
* Added FileCacheBase::typeSubdirectory() function and overwrote in HTMLFileCache. Fixes r98405 invalidating all existing cache due to directory change.
* Simplified FileCacheBase::checkCacheDirs() a bit

ResourceLoader:
* Use ResourceFileCache to handle load() requests, if $wgUseFileCache. Only caches requests for default language and skins. Single modules requests are always cached, whereas others require a certain threshold of traffic.
* Added ResourceFileCache class (functionality was initially to be in ObjectFileCache).
2011-10-02 17:53:33 +00:00
Daniel Friesen
8ca8e37db7 More RequestContext -> IContextSource. 2011-10-02 17:42:21 +00:00
Aaron Schulz
224541f861 Reverted accidental change in r98405 2011-10-02 07:29:39 +00:00
Aaron Schulz
6559b8bfcc FU r98405: various document cleanup 2011-09-29 21:17:43 +00:00
Aaron Schulz
6014f0db91 HTMLFileCache refactoring:
* Rewrote class and split into three classes: a base class, and html cache and a more generic cache to be used later.
* The new classes now use RequestContext.
* Renamed fetchPageText() -> fetchText().
* Split out new saveText() function from saveToFileCache().
* Various other cleanups and fixes.
Also fixed backwards setting of $wgDisableCounters in rebuildFileCache.php.
2011-09-29 08:18:20 +00:00
Aaron Schulz
23c430f64a Added filecache support for history pages 2011-09-24 01:17:04 +00:00
Aaron Schulz
7fa47e0c8f Removed action=raw support from HTMLFileCache. Obsolete due to RL. 2011-09-24 00:37:11 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
Aaron Schulz
3ca3494e62 Removed ampersand in HTMLFileCache constructor 2011-07-01 22:01:48 +00:00
Aaron Schulz
16eb5f6e41 * Follow-up r90749
** Tweaked addAutopromoteOnceGroups() calls for performance
** Some doc tweaks and fixes
* Added NS_SPECIAL short-circuit on $wgTitle for file cache and removed unnecessary "is null" check
* Pushed "$action != 'raw'" check into HTMLFileCache
* Removed useless return value from performRequest()
* Added type hint to performAction()
2011-06-25 17:59:42 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Sam Reed
50d5b074d0 And some more parameter documentation!! 2011-05-28 16:31:00 +00:00
Platonides
b8bac4dec6 /* to /** 2011-05-22 22:10:08 +00:00
Sam Reed
15df9a9d5c Kill off the long deprecated $wgInputEncoding and $wgOutputEncoding globals 2011-05-06 22:09:47 +00:00
Sam Reed
8e0ac8db63 Move 3 files into cache directory
Move in AutoLoader to cache section also
2011-04-25 21:33:38 +00:00
Renamed from includes/HTMLFileCache.php (Browse further)