Commit graph

802 commits

Author SHA1 Message Date
Nikerabbit
31069e3989 Merge "Use LogFormatter to format rights log." 2012-11-01 18:51:09 +00:00
Aaron Schulz
e2cac9d977 [JobQueue] Added a test job that just replaces itself.
Change-Id: I257d68099660a9c95e68f7662ae8d5cf1ebefe27
2012-10-31 12:47:52 -07:00
Reedy
cc18322559 Back out config table and related code
Change-Id: I4fa180d45984a4ec2b2c7b1149015c6dad14c5f0
2012-10-29 15:17:24 +00:00
Timo Tijhof
a4aef7d495 Fix warnings and enforce conventions in ContentHandler tests.
Syntax:
* Call parent setUp from setUp.
* Set required globals for the test inside the test class instead
  of assuming the default settings.
* Data providers are called statically and outside setUp/tearDown
  ("public static function")
* Test function names should be prefixed with "test"
  ("testIsRedirect")
* Marked 2 functions as unused. JavascriptContentTest has 2 data
  providers for tests that don't exist in it (nor in TextContentText)
  but do exist in WikitextContentTest.

Style:
* Single quotes
* Remove odd comment "# =====" lines
* Consistent tree wrapping with arrays.
  array(
      array(
          .. ) );
  array(
      array(
          ..
      )
  );
  Some were closing on the previous line instead.
  Made it consistent now.
* Remove odd indentation to make nested arrays line up:
  array( 'foo' => array(  'bar' => true,
                          'baz' => array() ) )
  array( 'foo' => array(
      'bar' => true,
      'baz' => array()
  ) )

  We don't do this kind of indentation because it is fragile
  and becomes outdates when any of the earlier keys ("foo")
  change. Converted to a regular tree instead.

  Also triggered git warnings for mixing spaces with tabs, which
  is almost always an detector for this style.

* Not using @annotations in inline comments, reserved (and only
  parsed/meaningful) for block comments.

Follows-up 8b568be5e2

Change-Id: Ic55d539b9a58f448b550bcd98894d389764e0694
2012-10-25 22:37:32 +02:00
Aaron Schulz
f555a1922f Moved core Job classes under includes/job/jobs.
Change-Id: I9257bb0fce9791190f731d72b2e882a1ae400f35
2012-10-22 17:25:58 -07:00
Alexandre Emsenhuber
4c69cd3ad6 Use LogFormatter to format rights log.
* Has to keep actual messages for IRC notification
* Catch really old log entries with no parameters and use an
  appropriate message in that case to not always display erroneous
  "X changed group membership for Y from (none) to (none)".

Change-Id: Ie188bc6fcdf672fe31f0f389a158aab6256031fa
2012-10-22 19:28:32 +02:00
jeroendedauw
bccf2755d4 Moved ContentHandler deriving classes into their own files for better discoverability and more manageable line count per file
Change-Id: I37db53e1d1420e61d3af4566322bcdba85ec778b
2012-10-16 20:20:43 +02:00
jeroendedauw
d455598c94 Adding a base query API module that allows very easily creating query modules for tables that have an associated ORMTable class
Change-Id: I4a68e4b014ed093779312c2493b492687947c170
2012-10-16 14:59:58 +02:00
ASchulz
b567f3602e [JobQueue] Job queue refactoring and generalizing.
* Added support for different queue types and methods for storing queues.
* Treat each job type as being on its own queue, at least logically.
* Added $wgJobTypeConf to configure queue types for each job type.
* Improved the job DB table so that duplicate job checks actually work
  and are faster. Also improved the method for popping rows of the table.
* Disabled duplicate job removal for everything except refreshLinks.
  The DELETE statements just add DB overhead and are not useful for cheap
  jobs, especially ones with start/end params (which are unlikely to have
  exact duplicates).

Change-Id: I49824c7fa855fea4ddcac5c9901ece8c2c0101d0
2012-10-16 09:39:58 +11:00
daniel
41b0a79455 Support plain text content.
Made TextContent and TextContentHandler usable directly.
CONTENT_MODEL_TEXT is unused in core, but may be used by extensions.

Change-Id: I8963c968800b98e286cd917a1038a9905b3a0fef
2012-10-14 23:27:00 +00:00
Alex Monk
05e2913931 includes/ContentHandler.php does not exist, it's includes/content/ContentHandler.php
Change-Id: Ib3fef967913546ce2ae5de8ae4bc93fa40f4c146
2012-10-14 22:42:54 +01:00
umherirrender
fb2c1c645b Add separate fa_sha1 field to filearchive table
This allows sha1 searches with the api in miser mode for deleted files

Added script to populate the rows
Adding new field to selects and handle it in all places, where needed

Using a 10 byte index for the new field per
http://lists.wikimedia.org/pipermail/wikitech-l/2012-September/063429.html

Change-Id: Ie54a513fe361202e63df44be44a0fdd91926c974
2012-10-14 20:58:25 +02:00
jeroendedauw
7389d7c690 Added sites functionality, a much more generic and flexible version of the existing interwiki code
This code is meant to replace the current interwiki code, but does not do so just yet. It is however used by the Wikibase extension. This allows us to try out some more things and have the code stabilize more before we migrate over existing interwiki functionality.

Change-Id: I23c47c2c3909a1500350fb560a5f2ec654e2c37e
2012-10-12 17:47:44 +02: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
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
umherirrender
992c38b9f1 Remove autoloader for deprecated Database class
Follow up: I8e7549e6

Change-Id: Id71be89434d77558b48456d111c4a03faefc5e74
2012-10-06 10:21:24 +02:00
Alexandre Emsenhuber
d95acd5489 Added missing entries in AutoLoader.
Change-Id: Iaed7664e155f3a0afd87398d85a66eda081dd5e4
2012-10-05 22:12:03 +02:00
daniel
2b1016eb9d Split Content.php into one file per class.
Change-Id: Ib49d9ec729613dcc43d38d46cb133ff9df459d79
2012-09-24 22:51:53 +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
Tyler Anthony Romeo
e738203a8e Added PHP complement for mw.Time.
Figured since a JS Timestamp class was being implemented
it might be appropriate to create a complementary PHP
Timestamp class. Much of code is taken from wfTimestamp().

Note: Another change (I53dcf547) is attempting a related
issue. Not sure how much of scope overlap there is.

Change-Id: I68eb9f27eebe80df757187f634392e1bcba5551f
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
2012-08-30 20:44:09 -04:00
daniel
72952a082c merged master some more
Change-Id: I53f349e42336ce0426ea1aff939853b3cd728aeb
2012-08-29 15:37:17 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
Nikerabbit
5aabfd9206 Merge "Add CLDRPluralRuleError, added in parent commit, to the AutoLoader" 2012-08-28 06:18:45 +00:00
Tim Starling
ad03f2f753 Revert Uri class due to bug 39710
Revert 94f623363b. Apparently all
ReverseChronologicalPager subclasses were broken by the unexplained
interface change in wfArrayToCgi(): changing the interpretation of
null array values from "omit this key" to "include this key with no
value". The function has always been called with the former
interpretation, that's why the special case was in there.

Also reverted dependent changes 4b517fa and part of 3d97704.

Change-Id: I41dadbde5d0e0e4c54cc76bfc13c263c15c73828
2012-08-28 10:53:09 +10:00
Platonides
5268a92a19 Add CLDRPluralRuleError, added in parent commit, to the AutoLoader
Change-Id: Icac9fec9264b42202eddc61905f476693df57de2
2012-08-27 22:23:09 +02:00
Nikerabbit
08e7fab367 Merge changes I1aa3b081,I65ee788c,I58a9cdfe
* changes:
  Adding JavaScript CLDR plural parser.
  CLDR plural parser in PHP
  CLDR Plural rules based plural form calculation
2012-08-23 18:40:31 +00:00
daniel
266b66c899 Revision::getContent must return clone if mutable
Revision::getContent must return a cloned instance of the Content object
if the Content object is mutable to avoid confusion.

Content::copy is used to achieve this, which is specified to return $this
for immutable Content.

Change-Id: Iace17b6ae8aa85a3500624441b69bc067c1ade00
2012-08-21 12:48:29 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
umherirrender
fcd6bb547f (bug 22749) Create Special:MostInterwikis
This special pages counts all langlinks and shows the pages with the
highest count.
Update rate on WMF is every 3 days, like all other Most* special pages.

Change-Id: Ia60aed7599e8b9d6dcbae2be9bc4f91f4f8d4e55
2012-08-19 15:54:15 +02:00
Santhosh Thottingal
bbbcf089db CLDR Plural rules based plural form calculation
* Use the plurals.xml of CLDR for the plural rules of languages
* Use plurals-mediawiki.xml to override or extend the rules inside MW
* Remove the convertPlural method in each LanguageXX.php
* Parse and load the xml files in LocalisationCache
* Use the CLDRPluralRuleEvaluator.php for parsing the cldr plural rules
  (This is taken from Translate extension and might require a replacement
   parser without using eval)
* Add getPluralRules() to make the CLDR plural rules available to JS.

PS3: More method documentation, cleanup

Change-Id: I58a9cdfe60c7b9027bf031c91370472054f04ae2
2012-08-16 11:45:17 +10:00
Aaron Schulz
1b7045e341 Added UserCache class for doing name/title batch lookups.
* Made Special:ListFiles be the first user of this class.

Change-Id: I2ea068d4765fe6ae12445786c38217119e79f823
2012-08-14 14:59:03 -07:00
Aaron Schulz
233633426a Merge "Added GenericArrayObject class and associated test base" 2012-08-14 03:22:01 +00:00
jeroendedauw
afe46f1403 Added GenericArrayObject class and associated test base
Change-Id: Id7e9b59c7ed4a9338744db58935307ecb4bc441f
2012-08-13 20:18:48 -07:00
Aaron Schulz
4190fe5b69 Merge "Added a Redis client for object cache storage" 2012-08-13 18:05:29 +00:00
Alexandre Emsenhuber
855277761a Follow-up I62ba23bd (a47892a): update AutoLoader comment.
Also moved the the section to the correct location.

Change-Id: I9cd2d65f7473c513b1fe86aa53e9f83be08a44da
2012-08-10 11:58:08 +02:00
Aaron Schulz
a47892abef [FileBackend] Moved filerepo/backend/ up to filebackend
Change-Id: I62ba23bd22e0f177fb48acaf6bcc38cbffacd3e7
2012-08-08 18:20:57 -07:00
Tim Starling
5800c37533 Added a Redis client for object cache storage
With sharding, failover and consistent hashing. Only supports the
extension (phpredis), since the pure PHP library Predis had about a
billion files and it made my eyes hurt.

Change-Id: I90fb4a41d15265b9c22f8e32ecd1d956f89f3ce8
2012-08-09 10:01:34 +10:00
Tim Starling
6eb6313b6f Allow session storage to be configured independently
* Introduce $wgSessionCacheType to allow the session storage to be
  configured independently of $wgMemc.
* Renamed $wgSessionsInMemcached to $wgSessionsInObjectCache to reflect
  the new versatility.
* Modernized the relevant code, removing the explicit require_once(),
  used the autoloader instead. Moved it to ObjectCacheSessionHandler.
* Tested with memcached, external sharded MySQL and APC, it all seems to
  work just fine.

Change-Id: I473334bb56cafb4e21ac1c1304d69095676fc0c4
2012-08-08 10:25:56 +10:00
Aaron Schulz
3d60b479de Merge "Add a Uri class." 2012-08-07 03:37:30 +00:00
Daniel Friesen
94f623363b Add a Uri class.
Add a Uri class matching our mw.Uri JS class for handling uris.
This class should be helpful in a bunch of places where we end up doing manual
concatenation of things like the path + '?' + query of a url parsed with wfParseUrl.

[tylerromeo@gmail.com: Removed cat() function, fixed wfWarn() usage for aliases
 and added visibility to all functions. Also added test for aliases.]
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>

Change-Id: Iefdedb7c80cf1d4aab58050edab3ab44ba868a58
2012-08-06 22:46:25 -04:00
jeroendedauw
df8245ba25 Split CacheTime into its own file
Change-Id: Iaa546fc5a30dad4bc0a0dbd0dc18dd2e05bf9d7f
2012-08-06 16:18:02 +02:00
Brad Jorsch
fdad41156c Allow manipulation of wl_notificationtimestamp via the API
It should be possible to query the notificationtimestamp as a page info
property, rather than only by querying the recent changes for the
watchlist. It should also be possible to clear or adjust the
notificationtimestamp via the API.

This patch does just that.

Change-Id: I8e2c0769e93802a6a09936899a41c07f9c4c9f25
2012-08-02 13:01:10 -07:00
daniel
c0b50eb47d merged master
Change-Id: I6afafe971afb3f38fc8f1e66ba409283b8a698f8
2012-08-02 11:01:22 +02:00
Antoine Musso
ddd162ef8b autoloader entry for UserNotLoggedIn class
I have forgot to add an autoloader entry for the new exception class
named UserNotLoggedIn (introduced by Id8127299 / b1c1448d).

Change-Id: Ib7226c8532fd695edf78f0e4c33b91edbf8ed52e
2012-08-01 12:48:41 +02:00
Jan Gerber
3bb6a37ae4 Split Generic into MediaHandler and ImageHandler
media/Generic.php contains two classes, split it
into MediaHandler.php and ImageHandler.php

Change-Id: Id5027b397e3156cf70312b3ffa37227ca5c3b81c
2012-07-24 05:08:12 -07:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +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
Siebrand
db99cb7a00 Merge "Add missing entry in autoloader for abstract test base class" 2012-06-28 20:40:11 +00:00