Commit graph

714 commits

Author SHA1 Message Date
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
daniel
a12ce17c6e Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.

This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.

This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.

Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.

Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.

Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
             but might break extensions when changed. Marking as todo for now.

Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).

Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
2012-05-13 20:53:37 +02:00
awjrichards
8653accc60 Integrating mobile device detection class into MW core
Change-Id: Ic7bbeba746ea37a92c1df5dbaa1fb4fd08da130c
2012-05-09 14:28:16 -07:00
Aaron
23a0490b78 [FileBackend] Added support for concurrent file write operations.
* FS backends work via popen() and basic shell commands.
* Swift backends use the custom SwiftCloudFiles async features.
* Refactored storagePathsRead()/storagePathsChanged() to normalize the paths
  for correct dependency detection in FileOpBatch.
* Cleaned up SwiftFileBackend exception handling to make debugging easier.
* Added a quick and dirty performance testing script.
* Updated unit tests to include a run with parallelize=implicit.
* Improved file test failure output a bit.

Change-Id: I6a5ed743c30c598e0dd7301dbdb3631c460332fd
2012-05-09 05:37:41 -07:00
Werdna
a97f5a1134 Merge "(bug 18195) Allow changing preferences via API" 2012-05-04 05:53:06 +00:00
Aaron Schulz
dd5326ccf1 [FileBackend] Added some basic directory functions.
* Added directoryExists() function to check if a dir exists.
* Added getDirectoryList() and getTopDirectoryList() functions to list out subdirs.
* Added getTopFileList() function to list out immediate files in a dir. This wraps getFileList(), which was modified.

Change-Id: I087835f40d76c41f5d6af55b9a34a51e0f44a675
2012-04-21 21:33:41 -07:00
Szymon Świerkosz
a6cd69d83a (bug 18195) Allow changing preferences via API
I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2

The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.

I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.

Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
2012-04-20 16:56:27 +10:00
Reedy
37b46ae357 Merge "Re-adding dbdataobject stuff which got pulled from core about 2 weeks back due to slush" 2012-04-18 17:49:44 +00:00
Jeroen De Dauw
cf6a935e1c CacheHelper: facilitate caching handling on a page
CacheHelper changes: adding a CacheHelper object to facilitate caching
several things on a single page and created implementations for
SpecialPage and Action also containing scaffolding for things such as
purging the cache

Change-Id: I7b1f8ac8ac2e37f15b3924d4448e579e6dbbc80f
2012-04-18 18:46:10 +01:00
Petr Onderka
720c1b7be0 Corrected capitalization in the file and class names of API modules
Change-Id: I8f317e458ee0f8706434e43a7890cda530595e64
2012-04-16 23:53:56 +02:00
Jeroen De Dauw
e4a0c04f7b Re-adding dbdataobject stuff which got pulled from core about 2 weeks back due to slush
Patch set 4: Move files to includes/db
Patch set 5: Update autoloader, pull in DB

Change-Id: I2b961e043dd1af9c843995bac7fc77bd671caa5e
2012-04-16 18:00:52 +01:00
Santhosh Thottingal
931c31c7bd (bug 33658) support for {{GRAMMAR:}} in jqueryMsg
This add GRAMMAR support to the mediawiki.jqueryMsg module:

1. make jqueryMsg understand GRAMMAR(case insensitive)
2. mw.language get convertGrammar, can be overridden per language as in
   php
3. Introduce resourceloader module ResourceLoaderLanguageDataModule
4. Language.php get a method to filter wgGrammerForms for the current
   contentLanguage.
5. Qunit tests
6. This code was originally written in jsgrammar branch of svn and had
   reviewed during the last slush time.

Change-Id: I90dd0b2f0cb30fd30539896c292829adc4fc7364
2012-04-10 11:47:39 +02:00
Kaldari
9ec8e3525b (bug 27757) API method for retrieving tokens
Change-Id: I58bc5847b996d100712781052f20150f76786ed1
2012-04-02 18:06:03 +01:00
Aaron Schulz
74e089667c [FileBackend] Moved scoped timeout stuff to its own file. Also removed some commented-out code (such a call would belong in LocalFile more so than here).
Change-Id: I0f0b7fe1a0f1da3fffe57c58b9f4d5a77d97cd29
2012-03-27 11:45:48 -07:00
Aaron Schulz
215be530dd [FileBackend]
* Added FileJournal class to log file changes for file backends. This can be used for migrations (like moving to Swift), syncing mirror repos, consistency checks, finishing/reverting operation batches, and such. The default journal is the "null" journal, which simply does nothing.
* Added the optional schema change required for using the DBFileJournal (MySQL, SQLite).

Change-Id: I33c9f9a598ba1f164c862b9dc3c718f9172db02b
2012-03-27 15:27:14 +11:00
Daniel Friesen
36b1172147 Add GitInfo class.
This adds GitInfo which is used by Special:Version to get the SHA1 of
the git repo.
It's also useful for development to put blocks of config in
LocalSettings.php that only apply to branches where you are developing
large features:

  if ( GitInfo::currentBranch() == 'myrewriteproject' ) {
    // […]
  }

Change-Id: I2a76662bb40080be6556d4edf60ac6714f36a727
2012-03-23 15:55:12 +01:00
Roan Kattouw
0fca9a7991 Revert r107309, r113601, r113704, r113742, r113792, r113838, r113859, r113893, r113894, r113952, r114047, r114252, r114256, r114257. This reverts the remaining 'new' revisions in core.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 00:16:50 +00:00
Roan Kattouw
311200ee2c Revert r114067, r114071, r114075, r114079, r114081, r114082, r114084, r114086, r114088, r114089, r114101, r114118, r114137, r114147, r114164, r114172, r114175, r114180, r114208, r114209, r114215, r114219, r114226, r114321, r114322.
This reverts the SpecialCachedPage and formatDuration sagas, with some collateral damage here and there. All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-20 23:03:59 +00:00
Daniel Friesen
e2ee009e5c Commit the cryptrand project worked on in git:
- MWCryptRand: A new api for generating cryptographic randomness for security tokens. Uses whatever cryptographic source is available and if not falls back to using random state and clock drift.
- wfRandomString - A simple non-cryptographic pesudo-random string generation function to replace wfGenerateToken which was written pretending to be secure when it's really not.
- Core updates to use MWCryptRand in various places:
-- user_token generation (to do this we stop generating user_token implicitly and only generate it when needed to avoid depleting the system's entropy pool by reading random data we'll never use)
-- email confirmation token generation
-- password salt generation
-- temporary password generation
-- Generation of the automatic watchlist token
-- login and create user tokens
-- session ids when php's entropy sources are not set
-- the installer when generating wgSecretKey and the upgrade key
2012-03-20 05:17:40 +00:00
Jeroen De Dauw
3cad6eb042 follow up to r114215, fix some fails and added CachedAction implementing the same stuff as SpecialCachedPage 2012-03-20 00:04:36 +00:00
Jeroen De Dauw
7c92fcab00 split general cache helper functionality to its own class, so we can also easily use it in stuff that does not derive from SpecialPage, such as Action 2012-03-19 23:33:25 +00:00
Jeroen De Dauw
b2134bbd0e adding special page with scaffolding for caching chunks of HTML 2012-03-17 22:26:02 +00:00
Aaron Schulz
d19f54602f [FileBackend]
* Added FileJournal class to log file changes for file backends. This can be used for migrations (like moving to Swift), syncing mirror repos, consistency checks, finishing/reverting operation batches, and such. The default journal is the "null" journal, which simply does nothing.
* Added the optional schema change required for using the DBFileJournal (MySQL, SQLite).
2012-03-13 01:46:33 +00:00
Aaron Schulz
ea99d8290a Moved FileBackendStore and helper classes to their own file (no code changes). Updated AutoLoader. 2012-03-03 18:29:38 +00:00
Daniel Friesen
d0a51ee5a4 Fix bug 34684 in my PathRouter code:
- Update the tests to test extra characters and patterns like like \\ and $1
- Also update the tests to make sure that matches that don't have enough data to work fail
- Replace the str_replace and preg_match based code with code based on preg_replace_callback.
2012-02-24 11:31:36 +00:00
Daniel Friesen
d293a19804 Revert CryptRand class in r111964 till after the git migration. 2012-02-20 22:35:14 +00:00
Daniel Friesen
3040055fc5 Commit a new cryptographic random generator class for use in MediaWiki.
Waiting for it to be reviewed before actually making use of it inside code and adding a RELEASE-NOTES entry.
2012-02-20 21:22:52 +00:00
Jeroen De Dauw
179ff65cb0 comment out inclusion awaiting putting this stuff back after slush 2012-02-15 22:59:06 +00:00
Jeroen De Dauw
a809eda1a4 follow up to r111264; split up class into one representing a table and one representing rows. Also getting rid of staticness, in particular LSB, so this becomes PHP 5.2 compatible. Not done yet, will follow up later 2012-02-14 18:11:52 +00:00
Brian Wolff
d5b26e049a Give a warning when people use $wgArticle. Add's a class that can be used to give warnings for other globals too.
See discussion on r111168.

Of course no one will see warning because trunk has $wgDeprecationReleaseLimit set to 1.17 by default
(<rant>have I mentioned how I don't like that variable. People enable warnings to be *warned* about
things. Making it so people won't get warned about things until a couple months after we've decided people
should stop using function/interface/etc defeats the purpose of having warnings</rant>)

p.s. Wasn't sure if this waranted something in the release notes, I don't think it does (It's just adding a warning)
but wasn't sure.
2012-02-13 00:19:06 +00:00
Jeroen De Dauw
b206cadcdb adding DBDataObject class after having some people review it and posting on the list. docs can currently be found at https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw/DBDataObject 2012-02-11 21:34:01 +00:00
Roan Kattouw
57310ab838 (bug 34289) user.options CSS loaded twice. Fixed by splitting off the CSS part of user.options into a separate module (user.cssprefs), as per the fixme comment added in r93363. No RELEASE-NOTEs because this is a regression fix that I'm gonna tag for backporting to 1.19 2012-02-09 11:04:24 +00:00
Sam Reed
728acedf72 Followup r110001
Add BadTitleError to AutoLoader.php
2012-01-31 15:56:17 +00:00
Aaron Schulz
92408acbfb Renamed FileBackend to FileBackendStore and ugly FileBackendBase to FileBackend. Callers doing things like FileBackend::extensionFromPath() are now more proper. 2012-01-29 22:22:28 +00:00
Aaron Schulz
0fc544635d * Moved FSFile classes from file/ to backend/
* Improved $this->lockCount check in LockServerDaemon
2012-01-24 02:46:21 +00:00
Niklas Laxström
b18bef923b Split LogPager out of LogEventsList.php 2012-01-20 09:44:39 +00:00
Aaron Schulz
95f31706ee In FileBackend/FileOp:
* Added a sane default max file size to FileBackend. Operation batches need to check this before trying anything.
* Temporarily adjust the PHP execution time limit in attemptBatch() to reduce the chance of dying in the middle of it. Also added a maximum batch size limit.
* Added some code comments.
2012-01-19 02:07:48 +00:00