Commit graph

750 commits

Author SHA1 Message Date
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
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
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
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
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
Tim Starling
fcd74e5dd3 Merge "Reduced some master queries by adding flags to Revision functions." 2012-06-28 05:11:04 +00:00
Aaron
8288b34eae Reduced some master queries by adding flags to Revision functions.
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
  Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.

Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
2012-06-27 20:59:20 -07:00
jeroendedauw
732b2ada50 Add missing entry in autoloader for abstract test base class
Change-Id: I44edbb02ae570f9c4b486c9f2c435bddb87e76d5
2012-06-27 14:32:35 +02:00
Aaron
0c187a776c Moved JobQueue.php file to Job.php
Change-Id: I0c2fd3e4095a61db96b7165d1f9bf79fff51ea72
2012-06-22 15:15:21 -07:00
Aaron
af1b39c4e0 [LockManager] Added a memcached lock manager class.
Change-Id: Ie99a7f1335bb5cceb0cb1c33a40094b3a22101ea
2012-06-21 22:05:55 +02:00
Hashar
fca84436cf Merge "[LockManager] Factored QuorumLockManager class out of LSLockManager." 2012-06-20 20:38:37 +00:00
Aaron
75b0c3230c [LockManager] Factored QuorumLockManager class out of LSLockManager.
Change-Id: I4031085faef4a1a7ce49dbeeb0b3ddf94d41132c
2012-06-19 12:52:47 -07:00
Aaron Schulz
8a02388500 Merge "Put skin classes in the Autoloader" 2012-06-19 19:33:53 +00:00
Alexandre Emsenhuber
3ee1b369f9 Update and fix AutoLoader definitions.
All these changes were found by running maintenance/checkAutoLoader.php.

Change-Id: Iffef080c8b0156af1fc6d4651c07e0e31e9c1674
2012-06-16 22:36:25 +02:00
Aaron Schulz
00ca49cda3 Merge "Added ORMIterator interface which can be used for type hinting (in particular when passing ORMResult objects)" 2012-06-15 19:09:51 +00:00
Catrope
e685dbf625 Put skin classes in the Autoloader
Also remove require_once() calls from skin files.

This fixes a bug introduced in 0ec77e2b31 where MySkin would throw a
fatal error because it couldn't find the MonoBookTemplate class.

Change-Id: I63bbe1d25e8cb70ee4baf99ec6e685444b663c1f
2012-06-14 18:41:33 -07:00
Max Semenik
63fb18bd4e Add a way for packagers to override some installation details
...after a discussion with Debian packagers. They can now override installer
classes and change LocalSettings.php the installer generates. The file
intended for such overrides, mw-config/overrides.php, has intentionally been
placed outside of includes to underline the "don't change includes" paradigm.

Change-Id: Id82b90f6740307609bc6c6f4fb8765bc3484dbe7
2012-06-12 20:18:44 +04:00
jeroendedauw
36a8c9b6ec Added ORMIterator interface which can be used for type hinting (in particular when passing ORMResult objects)
Change-Id: I0d14da35bf35be468a8e2c5530912992577e8dd8
2012-06-12 13:11:56 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Reedy
500a1401d2 Merge "Adding interfaces for ORM row and table classes so these can be used for type hinting in a way that does not prevent doing stuff such as the decorator pattern. Also made some minor fixes in the docs" 2012-06-01 13:58:05 +00:00
Max Semenik
aa305c06fe mobile sub-directories for mobile-related code
Move DeviceDetection.php and DeviceDetectionTest.php

Change-Id: Ia4aaf7ad499dd2021ef9d2ebf7f6d829e8fc4656
2012-05-29 16:48:28 +02:00
jeroendedauw
dc16ea18a7 Adding interfaces for ORM row and table classes so these can be used for type hinting in a way that does not prevent doing stuff such as the decorator pattern. Also made some minor fixes in the docs
Change-Id: I8ee1495a46d676062026d4d6b7acaae7bb227c42
2012-05-25 22:09:32 +02:00
Aaron Schulz
a86ae844e6 Merge "Workaround for autoloading when using php namespace." 2012-05-24 18:51:18 +00:00
mrbluesky
1aead61d4c Add and fix comments in some includes files
Change-Id: If781ad1a9eeba8310cef97dc9786685e8b265fa1
2012-05-24 20:42:56 +02:00
daniel
6d55d4450b Workaround for autoloading when using php namespace.
This is a Workaround for PHP bug <https://bugs.php.net/bug.php?id=49143> (5.3.2. is broken, it's fixed in 5.3.6):

Strip leading backslashes from class names. When namespaces are used, leading backslashes are used to indicate
the top-level namespace, e.g. \foo\Bar. When used like this in the code, the leading backslash isn't passed to
the auto-loader ($className would be 'foo\Bar'). However, if a class is accessed using a string instead of a
class literal (e.g. $class = '\foo\Bar'; new $class()), then some versions of PHP do not strip the leading
backlash in this case, causing autoloading to fail.

amended: as per Jeroen's suggestion, used // for comments and ltrim instead of preg_replace.

Change-Id: I71e0429ed1da5c83262dbf6f989c782385af9bcb
2012-05-24 19:06:54 +02:00
Max Semenik
fd17a43b07 Refactor DeviceDetection: make it OOP and extendable
Old interfaces are preserved for b/c for now. Stuff that needs to die
such as css_file_name has not been exposed for new interfaces.

Remove unused device properties.

Change-Id: I9b08eb81625a5570e700d9b690c03a001316de71
2012-05-23 01:35:38 +04:00
Alexandre Emsenhuber
44ec396481 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ife63db5d36d833de4e0944f9b79ab0f80e7b84c5
2012-05-22 20:43:10 +02:00
Aaron Schulz
ba7a5f70f4 Merge "Implemented a wrapper for the memcached PECL client" 2012-05-15 01:07:05 +00:00
Tim Starling
3c62077fe2 Implemented a wrapper for the memcached PECL client
* Introduced a common base class for the two memcached clients, called
  MemcachedBagOStuff.
* Moved the expiry time normalisation from MemcachedClient.php to
  MemcachedBagOStuff since libmemcached needs the same workaround.

Change-Id: I507d4ec5a7fd863ae64a94f2c453981f9f03746c
2012-05-15 10:19:41 +10:00
Aaron Schulz
060ba3cb68 Merge "Generalizing LinksUpdate to allow extensions to add arbitrary update handlers." 2012-05-14 22:20:04 +00:00
Tim Starling
6e49b1a966 Merge "[FileBackend] Added support for concurrent file write operations." 2012-05-14 07:23:29 +00:00