Commit graph

390 commits

Author SHA1 Message Date
Siebrand Mazeland
e9c996a1b8 Set visibility for class properties of DependencyWrapper
Set to private. No subclassing and no uses outside of the class in core or
extensions.

Change-Id: If195d02b8ce853242312de7fb4bc7dc1cbe94365
2013-11-18 04:52:49 +00:00
Siebrand Mazeland
7d11e65dcc Declare visibility on class properties of LCStore* classes
No direct references found in core or extensions outside of the classes
themselves. None of these are subclassed, so set all of them to private.

Change-Id: Id599c0830c1e6d3679c7ae55147f4444f8252987
2013-11-17 23:18:01 +01:00
Siebrand Mazeland
540d8dafeb Declare visibility on class properties of LocalisationCache
Mark all private, except the one that's being used in subclass. Checked
core and extension for direct uses. None found.

Change-Id: If73d65ca094ff56deb19d3b6f3ef99892654726d
2013-11-17 22:49:03 +01:00
Siebrand Mazeland
e711503e7a Remove underscore from classes LCStore_*
iPart of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core, and are updated in
this change.

Change-Id: I432dc249d22053728013ae7d0d56c3c398021c5e
2013-11-17 22:09:31 +01:00
Siebrand Mazeland
1e07d64050 Declare visibility for class properties of LocalisationCacheBulkLoad
Mark all as private. Not referenced elsewhere in core or extensions.

Change-Id: Ibe0e854f39261053e5147138309c3a4b1944e5fe
2013-11-17 22:03:53 +01:00
Siebrand Mazeland
04021a8e81 Remove underscore from class LocalisationCache_BulkLoad
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core, and are updated in
this change.

Change-Id: Ib157c3cf209677718ff184552cf872b1d3f4e969
2013-11-17 22:00:34 +01:00
Siebrand Mazeland
ddb4e02634 Break long lines in includes/cache/
Change-Id: I23a6f46f89b3cdcaf2a3b982dc63e779eed5840d
2013-11-17 21:49:59 +01:00
Siebrand Mazeland
8251479984 Update formatting
Change-Id: I9aa56cbe0989d6f302ee0f47c4a6154101f73e90
2013-11-17 21:46:55 +01:00
Aaron Schulz
a9dc4d943e BacklinkCache performance tweaks
* In partition(), avoid doing the JOIN since it is not needed and prevents
  index-only queries.
* Made numLinks() wrap partition when no $max is specified.
* Also fixed some docs

Change-Id: I05a83f71efb4c6e99e40883d7fa53da59184b13c
2013-11-09 12:35:07 -08:00
Tim Starling
64d0dc06a0 Move the DeferredUpdates hierarchy to its own directory
The grouping makes at least as much sense as job/, and certainly makes
more sense than cache/. With directories named after base classes, it is
fairly easy to tell what should go where. The grouping of
DeferredUpdates, DataUpdate and CallableUpdate would surely be
uncontroversial.

The move of SearchUpdate out of search/ demonstrates the conflict between
arrangement by module versus arrangement by type, which is the most
difficult design question here. I think arrangement by type is more
consistent with e.g. the arrangement of the core root, i.e. tests/,
resources/, maintenance/, etc. where a given feature will have its files
split up into a mostly type-based hierarchy.

I also tidied up AutoLoader.php by moving includes/content to the correct
location, sorted alphabetically by subdirectory.

Verified with AutoLoaderTest.

Change-Id: Ib369411d0caca38e72978084aa57348f1b892ed0
2013-11-04 10:32:40 +11:00
Siebrand Mazeland
e61cb8218b Update docs and declare visibility on class props
Change-Id: Ib0f02202d075d4a56dc4e37b08d7ac9399e8c86c
2013-11-01 12:35:27 +01:00
Brad Jorsch
db9c4cb3cf Remove linkprefix message, add $linkPrefixCharset
The existing "linkprefix" message is unlikely to be accurately
customized by message translators (as shown by the fact that, of the 10
distinct customizations prior to Iaa7eaa44 (which made them even more
complicated), 3 were broken or entirely ineffective, 1 was half
ineffective, and 2 more seem to have included the Latin-1 Supplement by
accident) or by local wiki admins. So, like linktrail before it, let's
move it out of the system messages and into a separate language
variable.

At the same time, let's make it a simple character set (like
$wgLegalTitleChars) rather than a complicated regular expression. The
complicated regex now lives in the parser.

This also adjusts the output of the API's action=query&meta=siteinfo and
adds an accessor parallel to the linkTrail accessor to Language.

Note the following changes that are not simply extracting the existing
charset from the linkprefix message for $linkPrefixCharset:
* The En message matched all non-ASCII UTF-8 characters by matching the
  component bytes (\\x80-\\xff). The new character set is equivalent.
* Various languages were identical to En and so have no $linkPrefixCharset
  set. These are: Ary Az Ce Ga Id Ka Kiu Km Ltg Mk Ms Ne Nn Ro Roa_tara Sc Si
  Sr_ec Sr_el Tl Tt_cyrl Tt_latn Ug_arab War
* Cu, Uk, and Udm are changed to match any number of „ or « in the prefix.
* Cv tried to include "«" that was redundant to the range \\x80-\\xff
  (see En comment). This was removed.
* Diq was entirely bogus, and so was removed.
* Gu included many additional UTF-8 characters that are redundant to the
  range \\x80-\\xff (see En comment). These were removed, and the
  resulting character set is equivalent to En.
* Mt has been broken since it was introduced in r37242. The charset used is
  equivalent to the broken regex.

Bug: 56031
Change-Id: I3369851b33113fc118a1bace38f3ac310cdd9725
2013-10-29 19:06:15 -04:00
Tim Starling
d1bc243f65 Remove all instances of the word "iff"
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
2013-10-23 10:56:54 -07:00
Bryan Davis
8b6be1c1ab Modernize SquidUpdate php code
- Update to PHP5 object coding style
- Fix @param comments using wrong argument order
- Add some phpdoc comments

Change-Id: Ia3190a6276e807ebef4f4aaeedc0e39819dc992a
2013-10-11 16:54:58 -06:00
MatmaRex
df8ec1e216 No spaces after (casts)
Also removed some unnecessary ones. I think I've caught them all.

The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.

Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
2013-09-04 20:05:43 +02:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
Antoine Musso
e137df71af $wgHTCPMulticastRouting rename + multi hosts support
This patch does two things:

A) rename $wgHTCPMulticastRouting to $wgHTCPRouting since you can have
   MediaWiki send purge packets over unicast.
B) add support for multi hosts purge in the few cases one want to split
   the multicast groups per cache role but still want to purge more than
   one cache group.

A) rename

The rename adds deprecation notices in the comments and adds a back
compatibility layer in the case someone is already using this feature.
Given Wikimedia Foundation is not even using it, it is very unlikely,
but yet: better safe than sorry.

My logic is flawed sometime, so that needs a bit of review :) There is
two levels of deprecations to watch for:
- pre mw1.20 which useds $wgHTCPMulticastAddress and
  $wgHTCPMulticastPort
- pre mw1.22 (aka before this patch) that used $wgHTCPMulticastRouting

The resulting configuration should be properly loaded in $wgHTCPRouting.

B) multi hosts

The HTCP routing let you split purges to different hosts according to
the URL.  In some case, we want to be able to purge an URL from more
than one multicast group.  A Wikimedia example would be to send text
related purges to the text and mobiles caches while upload purges are
sent to the upload caches.

An abstracted example would be:

$wgHTCPRouting = array(

	// upload URLs to upload caches
	'/(upload|thumbs)/' => array(
		'host' => '<ip for upload caches>'
	),

	// Everything else to text & mobile
	'' => array(
		array( 'host' => '<ip for text caches>' ),
		array( 'host' => '<ip for mobile caches>' ),
	),

);

Change-Id: Ie87f6b81007f47f9cb439371743f3ad9a4b0c774
2013-07-31 16:07:05 +02:00
Antoine Musso
9cf0a3d81f HTCPPurge() early exit on socket error
I tend to dislike code style such as:

	if( $ok ) {
		// lot of code
	} else {
		return false;
	}

The SquidUpdate::HTCPPurge() used that pattern to handle a
socket_create() issue.  I have simply moved the block above and inverted
the condition.  Ie:

	if( ! $ok ) {
		return false;
	}
	// lot of code

That saves a level of indentation and makes the code a bit easier to
follow IMHO.

Change-Id: Ic3c6e22bbb637352fef740a0c1663a4b6f5a2b6a
2013-07-16 14:41:27 +00:00
jenkins-bot
403b4fed47 Merge "Clear shallowFallbacks in LocalisationCache::unload" 2013-07-02 02:18:24 +00:00
Brad Jorsch
316bbe97ca Clear shallowFallbacks in LocalisationCache::unload
When a language code is unloaded, it also needs to clear the
shallowFallbacks entry. Otherwise the next time that language is used it
will incorrectly think that the other setup done by initShallowFallbacks
is still set up, leading to warnings.

Change-Id: Idf6a78f56a3bb864cc921427ac82972594610047
2013-07-01 16:53:29 -04:00
Antoine Musso
cf99ae3f28 SquidUpdate debug message are now in 'squid' group
To debug purging issues in beta, it would be useful to have all squid
related messages grouped at the same place.  wfDebug() is logged on beta
but it has a good amount of spam which is not that useful.  Regrouping
all squid operations under the debug log group 'squid' will make it
easier to investigate.

Change-Id: I11112585f38307ae56ec3e05e7a8d6d9dab31bfa
2013-07-01 15:16:43 +02:00
Kevin Israel
876bddf637 Change @since and @deprecated notes to 1.22
Using the following command line, I have found doc comments mentioning
"1.21" when they should mention "1.22" instead, which I have fixed
manually:

git diff REL1_21 | grep --color=always -C 10 -iE \
'^\+.*(since|deprecated).*1\.21(\D|$)' | aha > oldver.html

I also moved the release notes for I1987190f ("Combine JavaScript and
JSON encoding logic") from RELEASE-NOTES-1.21 to RELEASE-NOTES-1.22
because I had reverted the commit on REL1_21 only (see Id3b88102 and
bug 47431 for the rationale).

Change-Id: I11b917a371e07267dfa98b8449776d0c1cb29b15
Follows-Up: I25cf5a94f6e47f85a9d0b80cc1c9c9f957288478
Follows-Up: I3d72e4105f6244b0695116940e62a2ddef66eb66
Follows-Up: I3faa9c3e8107c6e46cdf21f8c18adda1f42890d7
Follows-Up: I6aab19c8d68bf47beddad42632b0360a7b12f251
Follows-Up: I86368821fc2cd0729df5342b8572eb470c0f77a0
Follows-Up: Id3b88102e768318e3605a19e9952121091a40915
Follows-Up: Ie667088010e24eb6cb569f9e8e8e2553005223eb
2013-06-21 05:33:22 +00:00
Brian Wolff
485daef140 UserCache::getUserName: Docs said @since 1.21, but not in REL1_21
Change-Id: I4ad85ee36ed348e8b082b5a4dba11d7cb92d8ad0
Follow-up: ef915e37e3
2013-06-19 16:17:52 -03:00
Tyler Anthony Romeo
126f66d955 Fix return type of MessageCache::getMsgFromNamespace for existing
Functions expect the message cache to return a string if a message
exists, even empty, and false if it does not exist. This adds casting
to the substr() function, which would return false for existing
messages that were just blank.

Bug: 14176
Change-Id: Id91914a3701fe53f1e2e894824512489392c628b
2013-06-12 08:48:05 +10:00
Antoine Musso
ca934127d7 LinkCache singleton can now be altered
This patch adds the ability to destroy the LinkCache singleton or to
replace the instance with a different object.  Note the $instance static
variable is now at the class level instead of at the method level.

Change-Id: Ib110ad061868834a52a6bac651976b3ffab4a6ce
2013-06-01 09:20:02 +02:00
jenkins-bot
a492cf4c34 Merge "doc: various updates" 2013-05-30 08:46:35 +00:00
Tyler Romeo
86b54375de Enable fallback languages when retrieving messages
The core function behind wfMessage() (MessageCache->get()) did not
apply the language fallback chain to on-wiki messages.

This patch has changed the behavior to iterate over all possible
languages, first checking on-wiki and then checking the CDB cache,
until it finds the message. Note that fallback languages never
take precedence over the actual requested language.

This patch was taken from the following changes and then
adjusted to fix issues that caused bug 46579.

* Change-Id: Iaaf6ccebd8c40c9602748c58c3a5c73c29e7aa4d
- Author: Matthew Walker <mwalker@wikimedia.org>
- (cherry picked from commit d434bfcf3b)
* Change-Id: Ib607a446d3499a3c042dce408db5cbaf12fa9e3d
- Author: Mormegil <mormegil@centrum.cz>
- (cherry picked from commit 1b8cb8dc31)

Bug: 1495
Bug: 46579
Change-Id: I420457863eeb79824698d06abc7784032b267af2
2013-05-26 15:46:35 +02:00
Antoine Musso
43ae2fb6f9 doc: various updates
[includes/cache/MessageCache.php]
- internal constants
- constructor
- a few missing @var

[includes/clientpool/RedisConnectionPool.php]
- group internal settings applying to the pool
- misc protected members updates

[includes/debug/Debug.php]
- missing parameter name in @var statements

Change-Id: I6ff0a68d659529d128f40f32b0fd1c1d39af952f
2013-05-20 12:02:37 +02:00
umherirrender
15ff79312d Fixed spacing and removed unneeded parenthesis
Added spaces after/before parenthesis
Removed unneeded parenthesis around some statements
Broke a long line

Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
2013-05-17 16:12:08 +00: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
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
Reedy
d560eb0b3e Revert "Commit of various live hacks"
This reverts commit c6af934ae6.

Change-Id: I3e863bb632531d7cd4ec0614325a7c4a7ba9aa3d
2013-04-29 19:19:54 +01:00
Reedy
c6af934ae6 Commit of various live hacks
Disable of MessageBlobStore clear

Reset $wgAutopromote (should be moved to a config change!!)

Disable setting of wgStyleSheetPath

Throttle page_touched

Add apc htcp packet numbers to SquidUpdate

Disable set names binary/utf8

Commment out searchindex table indexes

Was c532e81d583d3d0439fe76eea4d105d675461b56

Original revision Change-Id I42c4f859e55eb198f6c6841e582b3552aad7b31f
https://gerrit.wikimedia.org/r/#/c/7606

Change-Id: I5ec8dd53188e9e4128f99ceaff38ebf9dcf570bb
2013-04-29 15:46:38 +00:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
Brian Wolff
de1aefd55c Make UserCache only look up a user once.
I noticed on special:listfiles/username, UserCache was doing queries
like select user_whatever from user where user_id in ( '1', '1', ...)
with the same user id 50 times (one for each result returned in the
special page). That seemed a little insane, so put the list of
users to query through a array_unique. (Quite likely the db would
optimize that query to not literally look up the same user 50 times,
but nonetheless it seems better to filter the list before then)

Change-Id: I80c8a359d0f7a53b2420ebcda641e594dd3c56e9
2013-04-17 18:28:05 -03:00
Aaron Schulz
9906460241 Use onTransactionIdle() for page invalidations when not using the job queue.
* This will do the page_touched UPDATE in autocommit mode to avoid
  locking a bunch of titles for some unknown amount of time that
  depends on how big the transaction is.

Change-Id: I6ec16a73c11fbf19c24d2b7fe7d01f91b9dcf33a
2013-04-16 10:16:10 -07:00
jenkins-bot
562acce759 Merge "Cleanup and performance tweaks for BacklinkCache." 2013-04-16 06:50:19 +00:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
Aaron Schulz
135ae433d2 Made $wgMaxBacklinksInvalidate actually work.
* The check never worked before due to the 200 limit passed to getNumLinks().

Change-Id: I009c757c6437f22544a8d7d09d3534950c32c887
2013-04-12 10:48:10 -07:00
Siebrand Mazeland
57f7bfc662 Update documentation and styling
Remove some trailing whitespace, break long lines, make PHPDoc consistent
and update it in places.

Change-Id: I340b43a47e121a44ebd4aaa2a45dff12e945e645
2013-04-11 17:01:18 +02:00
Tim Starling
3c3ba5e03e Fix message cache expiry semantics
* Use the stale message cache while the new one is being generated
* Revert I811755d4 (make message cache load failure fatal). This
  escalated several very plausible temporary site issues from barely
  noticeable to complete downtime -- for example, memcached being down
  on a site with only one memcached server.
* Remove $wgLocalMessageCacheSerialized, it's always been pointless
* Clarify a couple of comments.
* Increased lock wait timeout to 30s
* Make lock() fail immediately on memcached connection refused

Tests done:
* With local cache enabled: normal cold refill; refill local from
  global cache; use stale local cache during remote refill; use stale
  global cache during remote refill; cold cache wait for remote refill;
  saveToCaches() failure; memcached connection refused.
* With local cache disabled: saveToCaches() failure; cache disabled due
  to "error" status key; memcached connection refused.

Setting a 1-day expiry in memcached, with a ~10s CPU cost to replace, is
not the best idea since it inevitably leads to a cache stampede. Dealing
with the stampede by waiting for a lock is not ideal, even if it were
implemented properly, since it's not necessary to deliver perfectly
fresh message cache data to all clients.

This is especially obvious when you note that barring bugs, expiry and
regeneration always gives you back the exact same data, because we have
incremental updates (MessageCache::replace()). Keeping all clients
waiting for 10s just to give them the data they have already is pretty
pointless.

So, continue to serve the site from the stale message cache while the
new one is being generated.

One caveat: if local caching enabled, when the message cache becomes
stale, a sudden spike in network bandwidth may result due to the full
array (also typically stale) being fetched from the shared cache.

Bug: 43516
Change-Id: Ia145fd90da33956d8aac127634606aaecfaa176b
2013-04-09 20:40:20 -07:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
umherirrender
007c1dc1d6 Add missing wfProfileOut to LocalisationCache
Follow up Ib94a8c18c4e270a7bd46faa17eb27a22ff950f75

Moved some empty lines to match the places of other profile calls in the
file.

Change-Id: I6616b18027cdb9e70b43948aaff999a2e25b07e0
2013-04-08 19:37:17 +02:00
Max Semenik
da5c29cdd4 LocalisationCache: add profiling, fix doxygen warnings
Change-Id: Ib94a8c18c4e270a7bd46faa17eb27a22ff950f75
2013-04-06 01:18:40 +04:00
Aaron Schulz
4eb056d549 Cleanup and performance tweaks for BacklinkCache.
* Batch the queries to get the partitions.
* Improved caching of getNumLinks() with $max.
* Added a TTL to the ProcessCacheLRU use for sanity.
* Some small logic cleanups in partitionResult().
* Also cleaned up some code duplication.

Bug: 43452
Change-Id: I0b9710fe222b3d2cb4dc9ab2eeb0758873a8066c
2013-04-04 14:54:53 -07:00
Mwalker
757fb8071a Merge "Use MessageCache::getMsgFromNamespace() to fetch conversion tables." 2013-03-28 21:42:13 +00:00
Siebrand Mazeland
9d7e9c3141 Revert changes in fallback behavior
This patch set reverts the following:
* Iaaf6ccebd8c40c9602748c58c3a5c73c29e7aa4d
* Ib607a446d3499a3c042dce408db5cbaf12fa9e3d
* Ic59fd20856eb0489d70f3469a56ebce0efb3db13 (partially)

Bug 46579 comment 17 describes a desired solution. In
If88923119179924a5ec091394ccab000ade16b3e we are working on a fix, but it is
taking longer than we anticipated. There was a deployment window planned
about now, but we didn't make it. It makes sense to revert for now, and commit
a proper solution somewhere next week.

Bug: 46579
Bug: 1495
Change-Id: Iac7ac4357dd80e8cdb238a6a207393f0712b3fe5
2013-03-28 10:32:02 +00:00
Liangent
080a017fd9 Use MessageCache::getMsgFromNamespace() to fetch conversion tables.
After Iaaf6cceb, MessageCache::get() goes through the fallback chain,
which is unwanted for conversion tables (for example, we don't want
zh-hans table for zh, where zh means "no conversion"). Since the only
needed feature is to fetch text from MediaWiki namespace (conversion
tables in PHP are stored somewhere else), it is now changed to use
MessageCache::getMsgFromNamespace() instead to avoid fallbacks.

Change-Id: I46e0be31c9c0fe0a6e4923fc1aff0fbbadbf1d67
2013-03-28 13:47:56 +08:00
jenkins-bot
dc07116c22 Merge "Added UserCache::getUserName() convenience function." 2013-03-27 11:39:36 +00:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Kaldari
06b0967caa Allow the retrieval of the plural rule type for a given number
For example, find out which rule type should be applied for 5 items
in Arabic. The result would be 'few'.

This implementation should be non-disruptive and completely backwards
compatible (which is the main reason it isn't a lot simpler).

Change-Id: I3d72e4105f6244b0695116940e62a2ddef66eb66
2013-03-20 14:34:12 +05:30
Aaron Schulz
ef915e37e3 Added UserCache::getUserName() convenience function.
Change-Id: Ice6b5e8608927db588edb1e8458f7d74e53f1214
2013-03-18 15:03:49 -07:00
ASchulz
5bafa9545a Tweaked MessageCache locks to handle exceptions better.
Change-Id: I3066d8dbebc97abcc0567d71625f995d62549b4c
2013-03-15 05:47:44 +00:00
jenkins-bot
6114f05fc1 Merge "Correct case of Title::getPrefixedDBkey() calls" 2013-03-12 15:13:21 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
cd4dd7ca85 Correct case of Title::getPrefixedDBkey() calls
Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c
2013-03-09 21:14:22 +01:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Matthew Walker
d434bfcf3b (bug 1495) Enable on-wiki message language fallbacks
The core function behind wfMessage() (MessageCache->get()) did not
apply the language fallback chain to on-wiki messages.

This patch has changed the behavior to iterate over all possible
on-wiki fallbacks (starting with the user's language) before
using the built-in language cache (CDB files). Previously we only looked
for the existence of an on-wiki message in the users's language.

Performance wise, using the 'ab' language ('ru', 'en' fallbacks)
MessageCache::get (Averaged over runs and calls)
New Code: ~8.5% TET (110us/call)
Old Code: ~6.5% TET ( 90us/call)

TET: Total Execution Time

Change-Id: Iaaf6ccebd8c40c9602748c58c3a5c73c29e7aa4d
2013-03-06 19:54:02 +00:00
umherirrender
909d61056a fix hardcoded quote in BacklinkCache
Also make the IS NULL in upper case, looks better and sql reservered
words often written in upper case

Change-Id: I844ec37bbf3fb00d95a43dfd6f58db1e67724d53
2013-02-18 08:35:26 +00:00
IAlex
3f92a5672e Merge "remove space before semicolon" 2013-02-10 12:51:02 +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
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +01:00
jenkins-bot
3d2cedf096 Merge "Use ResultWrapper::numRows() instead of DatabaseBase::numRows()" 2013-01-11 23:10:05 +00:00
Aaron Schulz
6d2ed516be Fixed prefixed title text call.
Change-Id: I796a2cc1687a7d50c8874b002839133f5f5326c7
2013-01-10 21:30:48 -08:00
Aaron Schulz
b23188b8ad Added $wgMaxBacklinksInvalidate to avoid massive html cache invalidation.
Change-Id: I4fadded0e351883a907d307d64af31cdc6164240
2013-01-07 01:50:47 +00:00
Alexandre Emsenhuber
d85239a186 Use ResultWrapper::numRows() instead of DatabaseBase::numRows()
Change-Id: I87f059aaff72bf06ebc72ad3a7904cca8e11fab9
2013-01-06 11:52:40 +01:00
Aaron Schulz
c9e8a7012f [MessageCache] Cleaned message cache load() error handling.
Change-Id: Ic8d62fa4162b54c776d934bd7106978fb36a6d32
2012-12-19 12:50:53 -08:00
Aaron Schulz
940b57f1d3 Moved LocalisationCache under /cache.
Change-Id: I54b230376ed682d6a6b7d6fa4fd5ab133c8c8b1b
2012-12-16 07:14:48 +00:00
Chad Horohoe
551d81df41 Revert "Commit of various live hacks"
This reverts commit acddbc862a.

Change-Id: Iabf5f917938c347ca6ddc7a373c731f44f23363b
2012-12-10 20:56:45 -05:00
Reedy
acddbc862a Commit of various live hacks
Disable of MessageBlobStore clear

Reset $wgAutopromote (should be moved to a config change!!)

Disable setting of wgStyleSheetPath

Disable squid updates in HTMLCacaheUpdate invalidateTitles

Throttle page_touched

Add apc htcp packet numbers to SquidUpdate

Disable set names binary/utf8

Commment out searchindex table indexes

Was c532e81d583d3d0439fe76eea4d105d675461b56

Original revision Change-Id I42c4f859e55eb198f6c6841e582b3552aad7b31f
https://gerrit.wikimedia.org/r/#/c/7606

Change-Id: I5ec8dd53188e9e4128f99ceaff38ebf9dcf570bb
2012-12-10 13:33:12 -05:00
Reedy
d537d96868 Add numerous missing @throws to method documentation
Change-Id: Iba868e82a75fef7c7d011bc5be192bf059d037c0
2012-12-09 03:09:48 +00:00
Niklas Laxström
3117541201 Treat message cache loading as fatal
I suspect this is the primary cause we occasionally have
* Sidebar stuck in default values
* No gadgets at all
* Main page full of <int:custom-message> occurances

Change-Id: I811755d4c250800177c4ea9e509bf6e1d13443a0
2012-12-04 12:35:01 +00:00
Aaron Schulz
5ef62175bf [JobQueue] Improved refreshLinks/htmlCacheUpdate job de-duplication.
* Added JobQueue::deduplicateRootJob() function which uses cache
  records of the last time a "root" job was initiated for a task
  in order to invalidate prior jobs for that task. For refreshLinks,
  the "task" is basically "enqueueing the refresh jobs for title X".
* (bug 27914) Also added new Job::getDeduplicationFields() function
  and made use of it with refreshLinks to exclude things like 'masterPos'
  from duplicate job check comparisons for refreshLinks.
* (bug 27914) Always resolve refreshLinks2 jobs down to refreshLinks jobs.
  For each affected pages, one of them will get their job popped
  first, which will remove the duplicates for that page unless
  one page is in a refreshLinks2 jobs and the other in refreshLinks.
* (bug 37731) Made LinksUpdate/HTMLCacheUpdate defer the large
  backlinks query by doing it in an outer job.
* (bug 42065) HTMLCacheUpdate will no longer purge pages that were
  already purged since the job was added.

Change-Id: I71b743e0a38e60a874ca856e80cb761bea06b689
2012-11-28 09:29:41 +00:00
Aaron Schulz
12b76fcabb Made BackLinkCache use object caching better.
* This way, we can actually get persistent cache hits for
the HTMLCacheUpdate queries rather than always hitting a DB.
* Also moved BacklinkCache under the /cache directory.

Change-Id: I0666ee575fb42675f1a7dd9cb52665f0a12a66a9
2012-11-27 09:41:50 -08:00
Aaron Schulz
ae63b9ae10 [FileBackend] Stat caching improvements.
Callers often tend to end up calling getFileStat(), at least indirectly,
or in various successive function on the same path. This created RTTs
when the file didn't exist since negatives were not cached. This change
does the following:

* Cache definitive negatives (404s) in the process cache.
  Nothing is cached on failure (like network problems).
* Ignore process cache entries after a brief time period
  so long running scripts do not have overly stale entries.

Change-Id: I356bd9f48281e3c7e7a273778b2aca59c521a0c7
2012-11-16 12:14:20 -08:00
Aaron Schulz
e882babdbe Fixed MessageCache::parseText() and fixed docs for MessageCache::parse()
Change-Id: Ia297d9d0f893451a611051f9df7db3870b4c2333
2012-11-01 10:28:52 -07:00
Niklas Laxström
bda755617e Rewritten $wgAdaptiveMessageCache
This was developed for translatewiki.net, which has but
millions of messages in MediaWiki namespace. To avoid
exploding the message cache, not all of them can be
loaded. Instead of logging what messages have been
requested, now it uses the fact that if the
message has not been customised in the
site language, there is most likely
no reason to load it in any other
language either.

Change-Id: I6dd81b3858acfd2b73332e46668d46015e99c748
2012-10-26 12:48:52 -07:00
Aaron Schulz
f555a1922f Moved core Job classes under includes/job/jobs.
Change-Id: I9257bb0fce9791190f731d72b2e882a1ae400f35
2012-10-22 17:25:58 -07:00
Antoine Musso
9362bb6c56 miscellaneous doxygen warnings
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
  elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
  code.
* various undocumented function parameters
* typos in parameters declarations

Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
2012-10-22 14:00:08 +02:00
Tim Starling
6cb1fe1fe4 Fixed the caching of redirects in Squid
Was accidentally broken in Ie38ae198, where the request URL was compared
against the final target title, not the title of the redirect. Also
tested squid purges of redirects, since that code presumably hasn't been
tested for a while, and committed my very advanced testing framework.

Change-Id: Ib2ffe8e109bcc4859e22df5470bddfdb09e67afa
2012-10-17 11:00:07 +11:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02: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
daniel
bb51a58e57 Cleanup of Wikidata branch.
This cleans up several issues raised in comments to I3b2dad3a,
mostly style and merge artifacts.

Change-Id: I99f5e300a671db1353db151cd187ffd2e4478d03
2012-10-08 17:34:47 +02:00
daniel
be43796499 Comment cleanup
Change-Id: Ie41f680782502f2b70c1bdbf18da3ee790d48fe7
2012-09-13 16:21:54 +02:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
daniel
0139923580 fixing long lines
Change-Id: Iebcd40a1a37a3a93cc571fa2c2b0a87f53dc97a4
2012-08-20 21:33:07 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Antoine Musso
ef9534313e prevents some doxygen warnings
This patch fix misc issues reported by doxygen. Nothing fancy.

Change-Id: I98edc8c877019f1dc4a82a37bca518df2eb904fc
2012-07-15 22:32:48 +02:00
Aaron Schulz
878f5aae5c [FileBackend] Factored out code into ProcessCacheLRU class.
Factor out duplicated code into the new ProcessCacheLRU. It is a fixed
size an per process cache which invalidate the least recently used cache
key.

Change-Id: Ib4475f21879ef6286ce2a28f248acd296fdbd45d
2012-07-12 17:09:23 +00:00
Reedy
53205fe0bc Remove some old debugging code
Add a couple more bits of function parameter documentation

Change-Id: If355978801b2bfc8a51f642f53f2cea6f87fc351
2012-07-04 16:31:01 +01:00
daniel
906a1ba51f [bug 37746] string ids for content model and format.
The content model is stored as a varbinary(32), the format
as varbinary(64).

If the standard model resp. format is used, null is written
to the database instead of the actual id, saving space.

Change-Id: I32659b49a9ad3cb8ecae9019562cff7de42b65f9
2012-06-26 15:56:06 +02: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
daniel
f2b218381b make sure page_content_model gets loaded where appropriate in Title and LinkCache 2012-06-11 15:36:52 +02:00
daniel
5b2271e876 use Content::getWikitextForTransclusion() for message text 2012-06-08 09:41:04 +02:00
Platonides
ac97386173 Messages parsed through MessageCache should never show edit links.
Copy to MessageCache.php the r92703 (d70ad8c) fix.
Fixes bug 36975

Change-Id: I4551aa32b8ff04d2209807c188051878b033285e
2012-05-21 01:14:58 +01:00
umherirrender
0ea2c38727 Fill GenderCache inside ApiPageSet
the queries for title and pageids are own queries created by the api,
which does not use the GenderCache, that can produce a query per row

Change-Id: I932f8d9d1cfa751dbb6f5237e2de325527d3ff53
2012-05-16 16:46:22 +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
Catrope
c9047274d5 Revert "Commit of various live hacks"
Was meant for 1.20wmf2

This reverts commit 062773733d
2012-04-30 20:57:56 +00:00
Reedy
062773733d Commit of various live hacks
Disable of MessageBlobStore clear

Reset $wgAutopromote (should be moved to a config change!!)

Disable setting of wgStyleSheetPath

Disable squid updates in HTMLCacaheUpdate invalidateTitles

Throttle page_touched

Add apc htcp packet numbers to SquidUpdate

Disable set names binary/utf8

Commment out searchindex table indexes

Was c532e81d583d3d0439fe76eea4d105d675461b56

Change-Id: I42c4f859e55eb198f6c6841e582b3552aad7b31f
2012-04-30 20:10:13 +01:00
umherirrender
4989ddd423 strip off subpages direct in GenderCache
LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title

Add unit tests for GenderCache

Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
2012-04-21 10:34:22 +02:00
umherirrender
dfe61f64af GENDER should use the GenderCache
This reused the gender state of a user on a page. This is helpful for
special pages which shows the group name, because the each group name
used gender, which result in often use.

Change-Id: I8e816f54aaa100c3333e84e19299fd194323341d
2012-04-07 22:45:31 +02:00
Catrope
edd81d2a5d Implement routing for HTCP purges
This allows HTCP purges for different domains to be sent to different
multicast groups, based on regexes. Mark requested this so we could
separate the multicast groups for upload caches and text caches.

This code is UNTESTED, I'm mostly submitting this as a proof of concept
and to invite review by other core devs (specifically Tim).

Change-Id: Ie333a04131d6ca8394884ed1054f2baff55ab2d1
2012-04-06 15:04:27 -07:00
Catrope
edde0a423b Remove duplicate URLs in SquidUpdate.php
This has to be done in 3 places, because there are 3 public entry
points.

I originally submitted this to fight duplicates I thought I was seeing
in production, but it turns out I'm blind and the URLs weren't
duplicates after all. Nevertheless, preventing duplicate purges in the
SquidUpdate class is a good idea.

Change-Id: Idc21dd7d0b3b79572853b787fac746454d9178ea
2012-04-06 11:26:46 -07:00
Sam Reed
2d25a902e3 More of r113580 2012-03-11 22:05:54 +00:00
Robin Pepermans
9184dc83d6 Update core usage of getLanguageName[s]. 2012-03-08 20:56:26 +00:00
Tim Starling
d85a86baa1 Fix for r86304: if MessageCache::parse() is called twice, once with $interface=true and then with $interface=false, actually use $interface=false the second time instead of using the cached value from the previous call. Same for $language. This is the reason why edittools was affected by bug 34832. 2012-03-02 04:00:58 +00:00
Aaron Schulz
1062d84d48 Fixed bogus call to method on a string 2012-02-16 05:04:17 +00:00
Sam Reed
e394044eae Add missing >
Ping r111324
2012-02-16 02:34:59 +00:00
Antoine Musso
1379b783aa Fix some injection from r110871 2012-02-12 19:51:03 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Aaron Schulz
18df3d63bd Made loadFromFileCache() always disable $wgOut regardless of whether compression is used 2012-02-09 18:53:35 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Sam Reed
138ddc452f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:42:35 +00:00
Antoine Musso
9b6a4c922a debug statements for HTMLFileCache / Output 2012-02-09 10:56:36 +00:00
Antoine Musso
564919a0d5 make gzopen() portable by using binary flag
r110871 forgot the 'b' flag which make sure gzopen handle file
content in binary form. That is for portability accross platforms.
2012-02-08 07:03:20 +00:00
Antoine Musso
8cbd865d2c simplify FileCacheBase::fetchText
Implements a proposal by Tim on r98405 CR
2012-02-07 20:47:45 +00:00
Antoine Musso
1cb1abe773 add up comment for FileCache rewrite (r98698) 2012-02-07 17:56:32 +00:00
Sam Reed
fa3ccef8b2 Merge r97508 changes to MessageCache.php and Skin.php into trunk 2012-02-07 16:49:34 +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
Niklas Laxström
055a1c485c Moved GenderCache to cache/ 2012-01-10 07:39:51 +00:00
Mark A. Hershberger
2447a305c7 Attempt to avoid a warning I got during input:
$ 7z x -so ../dewikisource-20111012-pages-meta-history.xml.7z | php maintenance/importDump.php 

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)

Processing archive: ../dewikisource-20111012-pages-meta-history.xml.7z

Extracting  dewikisource-20111012-pages-meta-history.xml
PHP Notice:  Undefined index: wgExtensionAliasesFiles in /home/mah/work/code/mediawiki/mw-
svn/includes/cache/CacheDependency.php on line 386                                                                                               
PHP Stack trace:
PHP   1. {main}() /home/mah/work/code/mediawiki/mw-svn/maintenance/importDump.php:0
PHP   2. require_once() /home/mah/work/code/mediawiki/mw-svn/maintenance/importDump.php:287
PHP   3. BackupReader->execute() /home/mah/work/code/mediawiki/mw-svn/maintenance/doMaintenance.php:105
PHP   4. BackupReader->importFromStdin() /home/mah/work/code/mediawiki/mw-svn/maintenance/importDump.php:93
PHP   5. BackupReader->importFromHandle() /home/mah/work/code/mediawiki/mw-svn/maintenance/importDump.php:249
PHP   6. WikiImporter->doImport() /home/mah/work/code/mediawiki/mw-svn/maintenance/importDump.php:282
PHP   7. WikiImporter->handlePage() /home/mah/work/code/mediawiki/mw-svn/includes/Import.php:411
PHP   8. WikiImporter->processTitle() /home/mah/work/code/mediawiki/mw-svn/includes/Import.php:534
PHP   9. Title->userCan() /home/mah/work/code/mediawiki/mw-svn/includes/Import.php:788
PHP  10. Title->getUserPermissionsErrorsInternal() /home/mah/work/code/mediawiki/mw-svn/includes/Title.php:1557
PHP  11. Title->checkSpecialsAndNSPermissions() /home/mah/work/code/mediawiki/mw-svn/includes/Title.php:2118
PHP  12. Title->getNsText() /home/mah/work/code/mediawiki/mw-svn/includes/Title.php:1728
PHP  13. Language->needsGenderDistinction() /home/mah/work/code/mediawiki/mw-svn/includes/Title.php:723
PHP  14. LocalisationCache->getItem() /home/mah/work/code/mediawiki/mw-svn/languages/Language.php:442
PHP  15. LocalisationCache->loadItem() /home/mah/work/code/mediawiki/mw-svn/includes/LocalisationCache.php:218
PHP  16. LocalisationCache->initLanguage() /home/mah/work/code/mediawiki/mw-svn/includes/LocalisationCache.php:283
PHP  17. LocalisationCache->isExpired() /home/mah/work/code/mediawiki/mw-svn/includes/LocalisationCache.php:395
PHP  18. GlobalDependency->isExpired() /home/mah/work/code/mediawiki/mw-svn/includes/LocalisationCache.php:367
2012-01-04 16:29:01 +00:00
Tim Starling
0463749a26 Comment and whitespace fixes 2011-12-27 22:38:44 +00:00
Aaron Schulz
15beeb4d40 Follow-up r98698: Reduce amount of ipv6 spam in FileCacheBase::incrMissesRecent() per CR 2011-12-23 07:41:23 +00:00
Alexandre Emsenhuber
74b9522134 Declare constant default values directly in the class definition and removed the constructor since it's useless now 2011-12-21 18:53:00 +00:00
Niklas Laxström
9f9242ce6f Gender is already needed in addResultToCache 2011-12-08 08:51:21 +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
Sam Reed
52cd34acf5 More documentation 2011-10-29 01:53:28 +00:00
Sam Reed
450814de00 More documentation updates 2011-10-28 18:11:47 +00:00
Aaron Schulz
6918f1d62d FU r98405: ObjectFileCache doesn't need to be abstract 2011-10-06 21:13:38 +00:00
Happy-melon
a73791be74 Documentation and type hinting. 2011-10-06 13:22:53 +00:00
Aaron Schulz
41a09896c1 * Added a script to prune old file cache entries.
* Use default .cache extension for ResourceFileCache. No need for js/css extension, and makes extension sanity check in prune script simpler.
* Removed redundant setting of mExt in ObjectFileCache
2011-10-04 08:03:43 +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
2bb5bec447 Follow-up r98698: cache urls with 'version' param...which is kind if important 2011-10-03 05:32:48 +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
Sam Reed
fdc70c6a3d More spurious code r98467 2011-09-29 22:17:20 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +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
Brion Vibber
ea44989fe4 Debug logging and possible fix for bug 31177: mystery sidebar message failures
This may be related to things failing on load from External Storage; however we have not yet been able to verify this.

Tweaks MessageCache::loadFromDB() and MessageCache::getMsgFromNamespace() to avoid storing empty cache entries when loading text fails.
When building initial cache if we get a failure we'll log and store a '!TOO BIG' message which requests on-demand load later.
If an on-demand load failures, we'll log and return the false through but won't update the cache with the bad value.

To enable the logging in production, set up a $wgDebugLogFiles entry for 'MessageCache'.

Note that MessageCache::loadFromDB() bypasses Revision's text entry memcaching and may cause a lot of ES fetches at once.
However any ES failures *should* already be logged in the 'ExternalStoreDB' log file.
2011-09-27 00:41:24 +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
Niklas Laxström
efb7b817a7 I broke few parser tests in r97633 by overlooking the return value. This fixes them. 2011-09-20 16:26:39 +00:00
Niklas Laxström
c49610741d Added LinkCache::addGoodLinkObjFromRow, since addGoodLinkObj is not going to work much longer when new parameters are added 2011-09-20 15:19:18 +00:00
Niklas Laxström
95a2c1b398 No need to check isset before unset, shortens the code a bit, and added some whitespace 2011-09-20 13:52:47 +00:00
Sam Reed
40fa861e62 Simplify array( 'page_id IN (' . $dbw->makeList( $batch ) . ')' ), to array( 'page_id' => $batch ), 2011-09-19 18:46:57 +00:00
Roan Kattouw
0b9b787acf Merge r82361 from 1.17wmf1 to trunk. This shuts up "Non-string key given" exceptions in cases where a numeric key manages to become an integer somehow. This could probably be fixed in a better way but I wouldn't know how. 2011-09-15 11:12:19 +00:00
Roan Kattouw
ae46d7fcfd Introduce MessageCache::getAllMessageKeys(), which returns all message keys stored in the MessageCache, and use this to power the amincludelocal parameter in meta=allmessages which adds messages that don't exist in PHP but exist as MediaWiki: pages only. 2011-09-14 19:59:50 +00:00
Sam Reed
fb32210aee Whitespace/documentation 2011-09-14 15:07:20 +00:00
Sam Reed
b70eeefc94 Followup r86304, guard against $title AND $wgTitle being null
Add profiling too
2011-09-14 12:32:22 +00:00
Chad Horohoe
22b599e06c Refactor deferrable updates into classes & interfaces, also add helper method for the most common use case:
$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, "sometable" );

I kept b/c with $wgDeferredUpdateList for now, but seeing as only 3 exts in svn use it (FileSearch, FlaggedRevs and WikiScripts), I'd like to deprecate it pretty soon :)
2011-09-10 06:50:30 +00:00
Roan Kattouw
ee24d7b289 Actually fix bug 30792, despite my earlier claims. SquidUpdate::purge('//upload.wikimedia.org/foo') would return 'http://commons.wikimedia.org//upload.wikimedia.org/foo'
Introduce PROTO_INTERNAL much like PROTO_CANONICAL, and use it in SquidUpdate::purge()
2011-09-07 14:15:03 +00:00
Platonides
061f4f07a6 Unused variables.
$wgContLang in CategoryPage was probably removed with the better directionality improvements.
$wgServer, $wgRequest in getFullUrl() unused since r94375
Other variables added in r95396 iwtransclusion merge.
2011-08-27 18:28:04 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
Sam Reed
2a4c94f90e Documentation 2011-07-12 19:59:35 +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
Alexandre Emsenhuber
c9bad93715 Removed usage of error suppression operator 2011-06-03 10:20:45 +00:00
Sam Reed
4065e65d03 Even more documentation in various files 2011-05-29 14:24:27 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Sam Reed
50d5b074d0 And some more parameter documentation!! 2011-05-28 16:31:00 +00:00
Sam Reed
ba0cbdeeff More parameter documentation!! 2011-05-28 15:59:57 +00:00
Sam Reed
c73746981c Param documentation updates/added 2011-05-26 19:21:50 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Platonides
b8bac4dec6 /* to /** 2011-05-22 22:10:08 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Niklas Laxström
7fe4a8e1bb Fixed a bug in transformation where previous language could leak into later transformations in UI language. Not sure what do with userlang. 2011-05-15 07:16:25 +00:00
Sam Reed
c444d03a0e HTMLCacheUpdate->invalidate() deprecated since 1.16, unused 2011-05-06 23:15:01 +00:00
Sam Reed
15df9a9d5c Kill off the long deprecated $wgInputEncoding and $wgOutputEncoding globals 2011-05-06 22:09:47 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Sam Reed
bc1c6d2a6b More parameter and return type hints 2011-04-25 22:41:54 +00:00
Sam Reed
93df2f1ac8 Move 5 more classes into cache/ 2011-04-25 21:38:48 +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