Commit graph

1173 commits

Author SHA1 Message Date
Siebrand Mazeland
603a35fc4e Remove underscore from classes CLDRPluralRule*
Part of program to remove underscores from class names. Checked core and 675
extensions for occurrences. All uses are in core in core are updated in this
patch. There are no uses in Gerrit extensions.

Change-Id: Id3ff16710a11ce1909a83b58505b250736a073e8
2014-04-21 19:23:37 +02:00
umherirrender
8ad1c92441 Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
2014-04-20 21:16:57 +02:00
Chad Horohoe
61a854fadb Remove FakeTitle
This doesn't seem to be used anywhere anymore and it's an awful class

Change-Id: Ie9047a346e410099c3082725ced83818846e95c2
2014-04-17 14:51:32 +00:00
Aaron Schulz
afa6af07d7 Profiler class refactoring
* Merged the "collate at end" and "running collate" logic
  into the base class to make it more unified and consistent.
* Pulled out DB code into ProfilerSimpleDB class.
* Removed the ProfilerSimple class and updated child classes.
* Made ProfilerSimpleTrace set the debug information too.
* Work around "ended by close()" bug from 99aef03f. Since the
  getRawData() method gets called while some wfProfileOut() calls
  have not yet happened, make it use the matched call data and let
  the final logData() method work on the full data as normal.
* Let ProfilerSimple classes use getFunctionReport() for the profiler
  debug log if it is setup instead of making it just return "".
* Made getRawData() work as best as possible with ProfilerMwprof.
* Removed $wgProfileToDatabase since it is now useless.
* Improved DB profile performance with sqlite.
* Updated visibility of various methods.

Change-Id: I1260bab2b5ba12dccbba701bcae4a637cb85c6e8
2014-04-14 16:46:55 +00:00
jenkins-bot
d6b075d238 Merge "Split CLDRPluralRuleEvaluator file" 2014-04-09 11:01:52 +00:00
addshore
fcd78a0bab Split CLDRPluralRuleEvaluator file
Change-Id: Iec9a939e3f28a600c841b89a2849f65d41763a62
2014-04-08 23:50:31 +01:00
addshore
6503a529d8 Move ConverterRule class to its own file
Change-Id: I0d743625e32f903ecd13f3c1f5aaeabdaca70f9d
2014-04-08 23:39:55 +01:00
Alexandre Emsenhuber
9e28936e81 Correctly order AutoLoader class definitions
- Group per directory
- Sort by class name for each directory

Change-Id: If4771f2868c2183f60a6321533142a1ad5cdc7cd
2014-04-05 18:30:13 +00:00
jenkins-bot
f1b45cbed4 Merge "New API module, list=prefixsearch" 2014-04-03 23:07:58 +00:00
Aaron Schulz
fbf97f572c Re-organized PoolCounter files
* No actual changes to the classes

Change-Id: I4e35a2b097e4bc72315688d0390d3f5c4c1ca4ed
2014-04-02 11:08:22 -07:00
Max Semenik
af6d9aba6d New API module, list=prefixsearch
It's pretty much like action=opensearch but can be used as a generator
which can be handy when you need to retrieve both the list of pages and
some information about them.

Change-Id: Iaffe30a0f7402e1316c4885a805692a34bbe1a6a
2014-04-02 19:14:07 +04:00
Aaron Schulz
eb03cf3f7d Added a Redis pool counter class
* This should be easier to set up for typical installs

Change-Id: Icb4a7481b944fa0818c4635e3edbe12d08af9924
2014-04-01 15:57:31 -07:00
jenkins-bot
6bd4f02747 Merge "Implement listing for tracking categories" 2014-03-30 22:44:08 +00:00
unknown
610236b467 Implement listing for tracking categories
Special page to implement list of Tracking Categories. Global
$wgTrackingCategories added containing list of tracking categories

Bug: 60333
Change-Id: I7d4bb90622a6bae60845942ef93cfe64f229d2d2
2014-03-29 14:50:39 +05:30
daniel
154bcdc63f Introducing TitleValue
TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.

This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.

The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.

More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.

Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4
2014-03-28 18:42:17 +00:00
jenkins-bot
69dbddc36a Merge "Add Special:ListDuplicatedFiles expensive query special page." 2014-03-24 06:09:13 +00:00
Brian Wolff
24276faf68 Add Special:ListDuplicatedFiles expensive query special page.
I saw some comments recently on commons suggesting that
better ways are needed to manage duplicate files (There are tools
for if a specific file is a duplicate, but no backlog of
outstanding duplicate files).

This seems like a fairly easy first step in that direction.

Wasn't sure if this should be an image gallery type
query page, or just a list. I think in this case a plain
list is more useful.

Change-Id: Ibe4b9da71ca6451ec4e6b0050feaf3ca70e1b888
2014-03-24 00:16:05 -03:00
Kevin Israel
2364ac099a AutoLoader: Remove "Class ... not found" debug message
Per existing FIXME comment: "This is not very polite. Assume we
do not manage the class."

Reverts the remaining portion of r44296 / 2f584f68a9 while
clarifying the "Give up" comment.

Change-Id: I4471f9376cae6b3c3e8df99e960770863ebf37ca
2014-03-21 11:42:14 -04:00
Chad Horohoe
7fc1a5b137 Break up SearchEngine.php into a couple of other files
Change-Id: I753eec1d0cf78f2ea08897c7fd3b83f2c88be18d
2014-03-19 20:14:17 +00:00
Aaron Schulz
96528b1f88 Avoid header notice log spam from RunJobs API
* Moved ApiRunJobs to a special page instead of going through
  ApiMain and having to fight the logic there. As a separate
  internal API, this does not show up on the API help page and
  is no longer effected by $wgEnableAPI.

bug: 62233
Change-Id: I1db6f526d02e130a66ee03289858a734d89e6c00
2014-03-18 22:30:50 +00:00
Aaron Schulz
400e4848ec Moved ProcessCacheLRU to /libs
Change-Id: I7052d04d9847f0310c1e62bd66365c813fddeab5
2014-03-16 16:32:34 -07:00
jenkins-bot
3ba51575cd Merge "Renamed /job to /jobqueue" 2014-03-16 11:41:29 +00:00
jenkins-bot
5086bae49c Merge "Add two new debug log groups" 2014-03-14 22:18:27 +00:00
Aaron Schulz
9ffd4f085d Renamed /job to /jobqueue
Change-Id: I4c8a2b42140630838867c77a70d45ba14b5d95e2
2014-03-14 13:42:04 -07:00
jenkins-bot
102076134f Merge "Add RCCacheEntryBuilder, split from EnhancedChangesList and cleaned up" 2014-03-12 16:40:28 +00:00
Siebrand Mazeland
b6adafc146 Fix CodeSniffer errors and warnings
For the files touched in I06ee0f01d8 as logged at
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-strict-HEAD/7798/console

Change-Id: I811884f7a5ada4d0551552d0a2c2775d6b17b59f
2014-03-12 12:50:43 +01:00
Bartosz Dziewoński
fc20c30d20 ChangesListSpecialPage: Separate all functionality for generating feeds
I should have done it at the beginning instead of trying to
extract it from recent changes.

Same for SpecialRecentChanges and SpecialRecentChangesLinked
(subclasses).

Created a new API module for it: ApiFeedRecentChanges.
It's somewhat un-API-like and hackish, but all feed modules are.

Old URLs redirect to new ones, so this should be fully
backwards-compatible assuming sane feed reader clients.

Change-Id: I06ee0f01d896bc66545a1800b24693ce7524e433
2014-03-12 12:31:41 +01:00
aude
1c6b7c7485 Add RCCacheEntryBuilder, split from EnhancedChangesList and cleaned up
This makes it more feasible for Wikibase, Flow, etc. to support
enhanced changes format, and allow better support for the rc_source
column in the future.

Change-Id: I873f6b86007000a94337f0c963df4bf8fec5b715
2014-03-12 11:23:49 +01:00
Kevin Israel
d6a9f3a2f2 Hide message for DBUnexpectedError exceptions
DBUnexpectedErrors are now treated like most other exceptions; we now
hide the error messages (which could contain sensitive information
such as IP addresses) unless $wgShowExceptionDetails is true.

In that case, the messages (and redacted backtraces) would be shown
even if $wgShowDBErrorBacktrace is false, though hiding them would
add complexity to the exception handler for little benefit.

Bug: 26811
Change-Id: I063c241975ce5b12a04abc21821ac67c716b3d5e
2014-03-04 19:59:57 -05:00
jenkins-bot
cb78f7f820 Merge "Make it possible for extensions to specify which version of MediaWiki they support via Composer." 2014-03-03 20:27:16 +00:00
addshore
58884580eb Split the rest of Action.php into /actions/
Change-Id: I071ac5778af63a5cffffd59d804c99b2c799d4e5
2014-03-03 12:31:57 +00:00
jeroendedauw
3307d49579 Make it possible for extensions to specify which version of MediaWiki
they support via Composer.

This change allows extensions to specify they depend on a specific
version or version range of MediaWiki. This is done by adding the
package mediawiki/mediawiki in their composer.json require section.

As MediaWiki itself is not a Composer package and is quite far away
from becoming one, a workaround was needed, which is provided by
this commit.

It works as follows. When "composer install" or "composer update"
is run, a Composer hook is invoked. This hook programmatically
indicates the root package provides MediaWiki, as it indeed does
when extensions are installed into MediaWiki. The package link
of type "provides" includes the MediaWiki version, which is read
from DefaultSettings.php.

This functionality has been tested and confirmed to work. One needs
a recent Composer version for it to have an effect. The upcoming
Composer alpha8 release will suffice. See
https://github.com/composer/composer/issues/2520

Tests are included. Composer independent tests will run always,
while the Composer specific ones are skipped when Composer is
not installed.

People that already have a composer.json file in their MediaWiki
root directory will need to make the same additions there as this
commit makes to composer-json.example. If this is not done, the
new behaviour will not work for them (though no existing behaviour
will break). The change to the json file has been made in such a
way to minimize the likelihood that any future modifications there
will be needed.

Thanks go to @beausimensen (Sculpin) and @seldaek (Composer) for
their support.

Change-Id: I8df66a92971146ab79cd4fcbd181e559115ca240
2014-03-03 08:45:20 +00:00
Aaron Schulz
2ea4d7ae8c Moved job running via $wgJobRunRate to a special API
* A background internal HTTP request used to load the API.
  This handles job execution and related periodic tasks.
  It avoids blocking the main request or breaking it on fatals.
* This method avoids problems that shelling could have:
** Mismatched apache/cli PHP config or versions.
** Had to start a new process and could not use opcode cache.
** safe_mode and open_basedir restrictions required a fallback.
** Some wiki farms may not respect the --wiki parameter.
** wgMaxShellMemory applies to spawned PHP processes.
** Spawning processes is more prone to DOS due to a lack
   of proper limiting/pooling.

bug: 60208
bug: 60210
bug: 60698
bug: 60844
Change-Id: I78b0e709301ac4a0c7b7ed337d6969d7546674bf
2014-02-27 19:12:04 +00:00
Alexandre Emsenhuber
2744ecb520 Add two new debug log groups
So that they are easier to separate from the main debug log.
The two news are:
- 'autoloader' for messages sent by the AutoLoader class
- 'caches' for the list of cache types

Change-Id: Ifb6dc2666fec2323219bbfac94ab53a422e5312a
2014-02-26 20:45:33 +00:00
jenkins-bot
84cfc8a135 Merge "Split Exception.php" 2014-02-24 22:52:24 +00:00
addshore
557af13086 Split Exception.php
Change-Id: I8273b342f8814887b65227457d0a461d7cd31e75
2014-02-24 21:17:59 +01:00
Brad Jorsch
0ce8a2ac12 API: Add prop=redirects and list=allredirects
While redirects can be sort-of queried using list=backlinks with
blfilterredir=redirects, we can get more accurate results with a module
dedicated to this purpose. We can also get the fragment of the redirect
without having to load the content of the redirect page and parse it.

I'm a bit surprised I was able to put together a query for this that
will work as a prop module. Or did I overlook something?

And then we may as well add the corresponding list=allredirects, to work
like alllinks, allfileusages, and alltransclusions.

Bug: 57057
Change-Id: I81082aa9e4e3a3b2c66cc4f9970a97eed83a6a4f
2014-02-24 11:01:44 -05:00
Skizzerz
f7174057a4 Add preliminary MS SQL support
This likely has outstanding bugs but basic wiki operations work just fine in it.

Change-Id: I25df82065a307b9abc30c694f8c8afff0996d7c1
2014-02-15 10:40:19 -08:00
Brad Jorsch
9832b28f12 Add API action=revisiondelete
Add action=revisiondelete to the API, and some functions to the
revisiondelete backend to support this.

Bug: 23005
Change-Id: Iee146fed648603b86a35927518f850771fc69bd2
2014-02-04 15:03:48 -05:00
jenkins-bot
a51ae81f11 Merge "Added a simple JobSpecification class for pushing jobs" 2014-01-29 16:58:18 +00:00
jenkins-bot
1d551bdf7b Merge "Split Title and User ArrayFromResult classes to own files" 2014-01-28 23:50:33 +00:00
Aaron Schulz
e049bcb87f Added a simple JobSpecification class for pushing jobs
* Both this and the full Job class can be used to push jobs

bug: 60403
Change-Id: I7e78321b5919e48fd8228580ddde7c90a6e4024e
2014-01-28 10:35:48 -08:00
jenkins-bot
529c02dc47 Merge "Config: Add Config and GlobalConfig classes" 2014-01-28 05:15:26 +00:00
Kunal Mehta
fbfe789b98 Config: Add Config and GlobalConfig classes
Allows configuration options to be fetched from context.

Only one implementation, GlobalConfig, is provided, which
simply returns $GLOBALS[$name]. There can be more classes
in the future, possibly a database-based one. For convinience
the "wg" prefix is automatically added.

Ironically, this adds the $wgConfigClass global variable
which is used to determine which implementation of Config
to use by default.

The ContextSource getConfig and setConfig methods were introduced
in I23194d1ba (1.23), but have no uses in Gerrit, so they can safely
be re-purposed.

Change-Id: I13baec0b6d4ea7badf20b9c5f9b40846348838e4
2014-01-27 21:10:30 -08:00
addshore
e3c0ab20bf Split Title and User ArrayFromResult classes to own files
Change-Id: I8744627330eb9c8f183a8d418d6eb168e6c5407b
2014-01-26 18:32:43 +00:00
jenkins-bot
a6f0a996eb Merge "Add Special:Diff as an internally-linkable redirect to diff pages" 2014-01-26 04:52:59 +00:00
Jérémie Roquet
ecc8114014 Add Special:Diff as an internally-linkable redirect to diff pages
This is similar to Special:PermanentLink added in r79036 and has been
asked for several times in different places, including:
- on the English Wikipedia (oldid=539308532)
- on mediawiki.org (lqt_oldid=31691)
- on the French Wikipedia (oldid=93029892)
- on the English Wikipedia again (oldid=588408888)

A notable use-case is linking to diffs in the edit summaries, where
external links are not yet allowed (bug 14892).

All of the following are valid usages:
- [[Special:Diff/12345]] (diff of a revision with the previous one)
- [[Special:Diff/12345/prev]] (diff of a revision with the previous one as well)
- [[Special:Diff/12345/next]] (diff of a revision with the next one)
- [[Special:Diff/12345/cur]] (diff of a revision with the latest one of that page)
- [[Special:Diff/12345/98765]] (diff between arbitrary two revisions)

Co-authored-by: Jérémie Roquet <jroquet@arkanosis.net>
Co-authored-by: Bartosz Dziewoński <matma.rex@gmail.com>
Change-Id: I77fdaf8e04375caa1d67ca4a3ec3bd93920c3309
2014-01-25 21:41:08 +01:00
addshore
853291c7d6 Split Timestamp.php into class and exception files
Change-Id: I438adfe5479a1017baee8f2b663f3fb2e49c685a
2014-01-25 16:24:04 +01:00
jenkins-bot
5bd46a50a9 Merge "Create ChangesListSpecialPage as a base class for Watchlist and RC" 2014-01-24 00:51:07 +00:00
jenkins-bot
bb70f87a13 Merge "Begin abstracting more of the database-specific search backend out" 2014-01-23 23:39:34 +00:00
Kevin Israel
1d049a7451 Installer: Remove two environmental checks
* envCheckPHP531: Message is outdated ("downgrade to 5.3.0"; the
  current minimum PHP version is 5.3.2), and PHP Bug #50394 has
  not reappeared in any later version.
* envCheckZE1: zend.ze1_compatibility_mode was removed in 5.3.0.

Also updated the error message for envCheckBrokenXML to remove
the "Upgrade to PHP 5.2.9 or later" wording.

Change-Id: Ifc8754151dd23a0314c6739cb78c7ac61a306bc4
2014-01-22 19:41:19 -05:00
Siebrand Mazeland
eabdda4fba Remove FakeMemCachedClient
Was deprecated in 1.18. Not used in core or Gerrit extensions.

Change-Id: I06bc9c6f01f21386c772fa7fad57b55a7c7b2fe4
2014-01-22 17:17:18 +00:00
Chad Horohoe
110eb02f3a Begin abstracting more of the database-specific search backend out
There's a lot in the base search implementations that is specific
to the database backed search. This starts moving some of that out
into a shared base class for those.

For starters, let's not grab a connection to the slave DB for
every single search for backends unless they need it.

Change-Id: Ib66696841eea901e04b21dd309784af889a45ab1
2014-01-21 17:53:16 -08:00
jenkins-bot
e6cf2f1af4 Merge "Removed RdfMetaData" 2014-01-21 17:02:18 +00:00
Aaron Schulz
4ebd4debf4 Removed RdfMetaData
* Unused by core or extensions

Change-Id: I3454d605a741bc97a51a1ad471a17eb3053d662f
2014-01-17 16:20:53 -08:00
Aaron Schulz
a0eef4ef0d Removed expiremental LSLockManager class
* This is pretty much obsoleted by RedisLockManager

Change-Id: I0feff44b5833072c8eb5a598169e1bb271d49de2
2014-01-17 15:16:01 -08:00
jenkins-bot
b2c14382e3 Merge "Removed ZhClient; unused by core and extensions" 2014-01-16 20:42:55 +00:00
Aaron Schulz
9f38f56fb5 Removed ZhClient; unused by core and extensions
Change-Id: Ieda34368b8e1c4a09dc244f47f7e09d943849b1e
2014-01-16 12:25:41 -08:00
Aaron Schulz
d8ca8c5df1 Moved SpecialPageFactory to specialpage/
Change-Id: Iaef958ea7831ec61e76002362672d5340e596348
2014-01-16 12:11:45 -08:00
Chad Horohoe
736820f8f2 Remove DBABagOStuff
Isn't useful outside of testing as the comments state, but it's
barely even useful for that. People who are testing the cache
code can use CACHE_DB if CACHE_MEMCACHED is too hard.

Change-Id: Ief0aa148376957fdd844c8bb585a133b854a012c
2014-01-16 11:43:59 -08:00
Chad Horohoe
19873e7693 Ehcache more like mehcache
mehcache isn't a caching system, it's a pun.

I'm removing Ehcache support because it's an experiment didn't pan out
and the code's just sitting here abandoned now.

Change-Id: Ief5728b4c61bb5ad8f5a5f0b55415b23ef6727eb
2014-01-16 18:44:09 +00:00
Bartosz Dziewoński
eabfeda3be Create ChangesListSpecialPage as a base class for Watchlist and RC
Most of the code has yet to be actually moved there, but it's a start!
It's full of @todo comments, I'm going to go through them later.

This should introduce no functional changes and no backwards
incompatibilities. Verified that all special pages being subclasses
work as they did before (SpecialRecentChanges, SpecialWatchlist,
SpecialRecentChangesLinked).

Change-Id: Icb7671e92a9255619e047ccbe5f457aa22581479
2014-01-16 19:25:27 +01:00
jenkins-bot
ef92af800a Merge "Revert "Mechanism for renaming/aliasing classes"" 2014-01-13 04:25:38 +00:00
PleaseStand
cb77e59f7c Revert "Mechanism for renaming/aliasing classes"
Seems good in theory, though not quite usable in practice.
As with subclassing, the aliases would not work reliably
for code that uses type hints and/or instanceof.

See <https://bugs.php.net/bug.php?id=61422>, which I was
previously unaware of.

The best alternative is to add class_alias() calls to the
class files themselves, as well as duplicate entries to the
AutoLoader (just like when multiple classes are in the same
file).

There is no good way to show deprecation warnings, which
likely would have to be implemented in PHP itself. For now,
renamed classes should be indicated in RELEASE-NOTES. Maybe
I will file an RfC (at <https://wiki.php.net/rfc>) for this
and related improvements (e.g. making class names case
sensitive).

This reverts commit c61fdb4ef5.

Change-Id: I9771b4239543b543cfa078f357db1cd3918f081e
2014-01-11 21:48:30 +00:00
Kunal Mehta
c1bc3607f8 Add XMLRCFeedFormatter
Endpoints like XMPP natively support sending XML,
which can be advantageous in some cases.

Since most of the logic is the same as the existing
JSONRCFeedFormatter, it was moved into an abstract
MachineReadableRCFeedFormatter class, which simply
creates the array and lets the implementations format
it.

Change-Id: I44f22777cb55fc1ca6527b79ef40b340e2afbd58
2014-01-10 17:50:41 -08:00
jenkins-bot
3de8536d3e Merge "Remove classes and functions deprecated in MediaWiki 1.17" 2014-01-09 21:11:51 +00:00
Aaron Schulz
2af7ad827d Removed cloudfiles dependency in SwiftFileBackend
* Added a new curl multi wrapper under libs/.
* Used the new MultiHttpClient class instead of CloudFiles
* Removed CDN related config and code as it does not work.
  well due to mutating files and tiny purge rate limits by CDNs.
* Also removed the unused and esoteric 'swiftAnonUser' parameter.
* Support concurrent 'describe' operations.
* Set ACLs on containers on intial PUT instead of in two steps.
  Previously if the second step failed, prepare() would never
  set the ACLs correctly since it aborts if the container exists.
* Improve token deletion to only trigger on 401s rather than other
  random errors like 50X timeouts.
* Removed duplicative getResponse* code by just using one closure
  called for both the concurrent and serial cases. Both cases are
  now funneled through doExecuteOpHandlesInternal().
* Add the MD5 to stat info, as it might be useful for speeding up
  the copy scripts in some cases (when both backends have md5 set).
* Avoid use of trigger_error() since there is a swift log group.
* A few other small code cleanups.

Change-Id: I1adb3e2df6df8cf01d3ad74158de96ea9a79da2e
2014-01-07 23:56:34 -08:00
Aaron Schulz
bb519a91df Moved HashRing to /libs
Change-Id: I0b74b386f7459f550816f99aa7e00970c3cff4c7
2014-01-07 22:18:09 +00:00
Aaron Schulz
deec3478c7 Moved MappedIterator to /libs and changed exception type
Now throws UnexpectedValueException rather than MWException.

Change-Id: Id466b66f43db97c5837030d166b9abd66fd56e0d
2014-01-07 21:12:43 +00:00
jenkins-bot
d2d519f482 Merge "Add ProfilerMwprof" 2014-01-07 21:11:11 +00:00
Ori Livneh
c5e6ce0f9e Add ProfilerMwprof
ProfilerMwprof is similar to ProfilerSimpleUDP in that accumulated profiling
samples are emitted to a remote host using UDP. Profiling data for sections
that are called multiple times are aggregating using the RunningStat class I
introduced in Ifedda276d; this provides the ability to compute timing variance
across multiple requests without storing individual values for a second pass
through the data.

Entries are serialized into MessagePack arrays, using the implementation added
in Id2833c5a9. The first element of each array is an entry type specifier.
Currently two types exist: TYPE_SINGLE (single sample; no statistical moments)
and TYPE_RUNNING (aggregated entry with statistical moments). Additional entry
formats may be specified in the future.

TYPE_SINGLE entries have the format:

  [ TYPE_SINGLE, name (string), CPU time (float), wall time (float ]

TYPE_RUNNING entries have the format:

  [ TYPE_RUNNING, name (string), count (int),
    CPU m1 (float), CPU m2 (float), CPU min (float), CPU max (float),
    wall m1 (float), wall m2 (float), wall min (float), wall max (float) ]

To help reviewers test this change, I have a trivial Python script that can
serve as the back-end: <https://gist.github.com/atdt/8290191>

Change-Id: I688e7231dad9fcc9d29954afacc47f55d521f58d
2014-01-07 13:03:11 -08:00
Brad Jorsch
e06ad68419 API: Add prop=contributors
Certain applications, such as the generation of PDFs, could use a list
of all non-anonymous contributors to the page (as well as a count of
anonymous contributors) without crawling the output of prop=revisions.
This patch adds a prop module to retrieve this information.

Including the IP addresses of anonymous contributors is not realistically
possible without further schema changes, so that is not done here.
Additionally, revisions with DELETED_USER will be skipped entirely.

Change-Id: Iaff50dfb09016154901a5197aa14eb9f8febcbc5
2014-01-07 04:09:47 +00:00
Kevin Israel
c61fdb4ef5 Mechanism for renaming/aliasing classes
Sometimes it is desirable to change a class name that is still referenced
in extensions or config files (e.g. for consistency, as in I507ba00a).
PHP's class_alias() function can help in preserving backward compatibility;
however, creating an alias first requires that the class be loaded.

Hence this is implemented in AutoLoader. Lazy loading continues to work,
the list of class names is still maintained in a central location, and
optionally, deprecation warnings can be generated.

Change-Id: I1d3fb04a448647b5be10bed7fec05238b9fc6fc7
2014-01-06 10:36:18 -05:00
Kevin Israel
4a7d1b86cd No need to return true/false from AutoLoader
Partially reverts r36942 (7e627faec6).

Change-Id: I5b3dfd148863413025c71de5fadef1cb5bd70dce
2014-01-05 21:21:53 -05:00
Siebrand Mazeland
52ba6500df Remove classes and functions deprecated in MediaWiki 1.17
Removed classes:
- WikiError (deprecated in 1.17)
- WikiXmlError (deprecated in 1.17)
- WikiErrorMsg (deprecated in 1.17)

Removed methods:
- ApiBase::getValidNamespaces() (deprecated in 1.17)
- ApiMain::setCachePrivate() (deprecated in 1.17)
- ApiMain::setVaryCookie (deprecated in 1.17)
- CategoryViewer::addSubcategory() (deprecated in 1.17)
- WebRequest::getFileSize() (deprecated in 1.17)
- WebRequest::isPathInfoBad() (deprecated in 1.17)

Change-Id: Id715c2391742c136d09f5369f88d67e798842af7
2014-01-05 18:54:27 +01:00
Ori Livneh
4d23c15a6a Move RunningStat from profiler/ to libs/
There is nothing about the class that mandates it be used exclusively for
profiling, or exclusively within the context of MediaWiki. The functionality it
provides is generic. So move it to libs/ to make it easier to discover & reuse.

Change-Id: Iac8f2f8e1c3231ebe76318d72cf6225e25a7b891
2014-01-02 22:52:37 -08:00
Ori Livneh
681607e55b Add class implementing MessagePack serialization
MessagePack is a space-efficient binary data interchange format. I am going to
use it to encode profiling data in ProfilerSimpleUDP. The official PHP
implementation is provided as a C extension, so using it would further
encumber migration to HHVM. This patch adds MWMessagePack, a class implementing
a pack() method for encoding native PHP values as MessagePack byte strings. The
implementation is based on <https://github.com/onlinecity/msgpack-php>, but
revised for clarity and conformity with MediaWiki coding conventions.

Change-Id: Id2833c5a9da659cb13ec1330de9dd57138ada9c8
2014-01-02 18:04:24 -08:00
Ori Livneh
766c11b516 Add RunningStat class, tests
RunningStat computes the central tendency, shape, and extrema of a set of
points online, in constant space. It uses a neat one-pass algorithm for
calculating variance, described here:
  <en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm>

This particular implementation adapts a sample C++ implementation by John D.
Cook to PHP. See <http://www.johndcook.com/standard_deviation.html> and
  <http://www.johndcook.com/skewness_kurtosis.html>.

RunningStat instances can be combined. The resultant RunningStat has the same
state it would have had if it had been used to accumulate each point. This
property is attractive because it allows separate threads of execution to
process a stream in parallel. More importantly, individual points can be
accumulated in stages, without loss of fidelity, at intermediate points in the
aggregation process. JavaScript profiling samples can be accumulated in the
user's browser and be combined with measurements from other browsers on the
profiling data aggregator. Functions that are called multiple times in the
course of a profiled web request can be accumulated in MediaWiki prior to being
transmitted to the profiling data aggregator.

Usage will be introduced in a dependent commit.

Change-Id: Ifedda276dfe8e0783cb8c4a95626e2aedd4ad368
2013-12-31 14:45:58 -05:00
jenkins-bot
d0fc29d788 Merge "Moved ScopedCallback to /libs" 2013-12-27 15:46:01 +00:00
Siebrand Mazeland
210edff11b Remove underscore from classes LBFactory_*, LoadBalancer_*, LoadMonitor_*
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core in core are updated
in this patch.

Patches for extensions:
* https://gerrit.wikimedia.org/r/#/c/96463/ CentralAuth
* https://gerrit.wikimedia.org/r/#/c/96460/ SimpleSecurity
* https://gerrit.wikimedia.org/r/#/c/96459/ WikiBase
* https://gerrit.wikimedia.org/r/#/c/96472/ Wikimedia configuration

Antoine added tests to test the back compatibility.

Change-Id: I507ba00a83bca8375a0215f00891b47e3c7afb9f
2013-12-26 16:30:15 -05:00
Aaron Schulz
9ee2b6f7fc Added a MemoryFileBackend class and made MockFileBackend subclass it
* This backend passes all filebackend and parser tests
* Fixed setupUploads() in parser tests to just use create() instead
  of using store() and having a race condition in the process
* Fixed 'use-filebackend=' for Parser tests

bug: 58094
Change-Id: Ib0c38183cb7f9f2325da98c8a8a1eb2b8e39a7aa
2013-12-19 12:38:00 -08:00
Bartosz Dziewoński
f2e55d1273 Rename SpecialRecentchangeslinked class to SpecialRecentChangesLinked
For consistency with SpecialRecentChanges.

This introduces no incompatibilities as PHP classes are case-insensitive.

Change-Id: I5855074deed52fd7492f033c8a8fced8af647602
2013-12-18 20:00:34 +00:00
Aaron Schulz
22af3c78c6 Moved ScopedCallback to /libs
* The MWException is now a standard PHP exception type

Change-Id: I59e3b435cee32efe84c67766e29976b126384389
2013-12-17 10:16:14 -08:00
Bartosz Dziewoński
0f614669b6 IcuCollation: Add CollationCkb subclass for Sorani Kurdish
ICU does not currently support Sorani Kurdish / Central Kurdish
language ('ckb'). CollationCkb uses the same collation rules as
Persian / Farsi ('fa'), but different characters for digits.

For use at ckb.wikipedia, which currently has 'uca-fa' collation
deployed as a workaround.

Added the MW language used for transforming digits to cache key for
first-letters data, in addition to the ICU locale.

Bug: 55630
Change-Id: I7d7f007592ede952859c5c9556b9ea5084b90e89
2013-12-12 04:44:33 +00:00
Bartosz Dziewoński
22c9aa5ec0 Split includes/SpecialPage.php
Separated base classes for special pages (most of them abstract) and
several actual special pages, which were previously both in the same
file.

Added license headings, @ingroup SpecialPage and updated class doc
comments; no other changes.

Most classes are now in separate files (the list of changes can be
seen by diffing AutoLoader.php), with three exceptions:
* SpecialListAdmins and SpecialListBots (redirects to
  Special:ListUsers with a parameter) joined their friend in
  includes/specials/SpecialListusers.php.
* SpecialMycontributions, SpecialMypage, SpecialMytalk,
  SpecialMyuploads and SpecialAllMyUploads were moved into a new file
  includes/specials/SpecialMyRedirectPages.php – each of them is
  literally ten lines of code and any changes are likely to touch them
  all, separate files seem impractical.
* RedirectSpecialArticle and SpecialRedirectToSpecial are in one file
  with their parent class RedirectSpecialPage (on a side note, I filed
  bug 58215 to rename them to something less silly).

Change-Id: Ida87238401b182924dbe169a6278588bc2fbecfd
2013-12-09 18:05:37 +01:00
addshore
976276338a Split includes/HTMLForm
Change-Id: I6eabfdb064c0e35b69efe9d6142e94df4128b632
2013-12-08 23:13:56 +01:00
Aaron Schulz
a0878fe2b4 filebackend: exception handling cleanups
* Split out FileBackendException class and reduced direct use of MWException

Change-Id: I325c1798b6d90972c12a5dccc37989af34d857f3
2013-12-07 23:22:07 -07:00
Aaron Schulz
77f7e9ba65 Added MapCacheLRU class, a simpler cousin to ProcessCacheLRU
Change-Id: Ibe1b44c8e168a086afb3481b4bb7660dc7d31ae7
2013-12-03 19:47:02 +00:00
Aaron Schulz
721731f43c Improved partitioning scheme for refreshLinks jobs
* The changes refreshLinks to handle both per-title (leaf) and backlink jobs.
  The base job now splits into some leaf jobs and a remaining partition job.
  The partition job does the same until there are only a small number
  of backlinks in the remaining range (so only leaf jobs are added).
  Since the leaf jobs are pushed first, this works well for FIFO queues
  to avoid bloating the queue. This also improves per-title job
  de-duplication, which isQueueDeprioritized() pretty much killed.
* The refreshLinks2 class is no longer used for new jobs.
* Fix process cache bug with JobQueueGroup::push with empty arrays.
* This adds a BacklinksJobUtils with helper functions for partitioning.
* RefreshLinksJob jobs now have a simple version parameter.
* Also moved refreshLinks2Job to its own file.

Change-Id: Id378d47df17248ae02938d5a54ef7ecd29efadbd
2013-11-26 16:02:44 -08:00
UltrasonicNXT
b2a84fbe87 Move ExpandTemplates special into core
Very little modification to extension, add some docs, and GNU license as
per the other core extensions. Removed $isNewParser, as it won't be needed
with new versions of MW, and changed the name of POST variables used.
I have not moved across any of the messages except
english, according to the bug report, translatewiki will sort this out.
The expandtemplates message section has also been added to messages.inc.

htmlspecialchars should not be performed on anything, as it will cause it
to render like &lt;root&gt;

Added this change into the 1.23 release notes.

Bug: 28264
Change-Id: I7ef63488dc3ad3885bcf99ff52852e1c6981942b
2013-11-23 16:52:49 +00:00
Siebrand Mazeland
f5003767a0 Rename classes DiffOp_* to DiffOp*
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core in core are updated
in this patch. No uses in extensions.

Change-Id: I86b8c6f8702e661554c7b794df09892db94a84d1
2013-11-20 20:28:14 +01:00
Siebrand Mazeland
4da81608c2 Rename class HWLDF_WordAccumulator to HWLDFWordAccumulator
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core in core are updated
in this patch.

Change-Id: Ib3094249ab192db80f1639c5e543ece84c688b9a
2013-11-20 20:24:48 +01:00
Siebrand Mazeland
a0c583e408 Remove unused classes Title[List]Dependency
Classes TitleListDependency and TitleDependency that are currently not
used. Searched core and extensions in Gerrit.

Change-Id: I51404ce36c4ef55393588817d1673fd17c81b4a2
2013-11-18 21:46:23 +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
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
MarkAHershberger
c24f8be729 Revert "Remove unsupported and mostly non-functional Mssql support"
This reverts commit 5e1efc3144.

This sort of thing needs to be discussed.  Please do not self-approve changes like this.

Change-Id: I9eb9ea315d90584b7fe95db43a6759884f9506b5
2013-11-16 02:06:01 +00:00
Chad Horohoe
5e1efc3144 Remove unsupported and mostly non-functional Mssql support
Change-Id: Id0a688865a5b7b6bb363f7b118fad4f455d2b3b6
2013-11-15 10:59:37 -08:00
Chad Horohoe
8af281f57f Remove extra space
Change-Id: Ia016d1d3ecb4712c29b4140ceb149c49f2a46c7a
2013-11-13 17:32:47 +00:00
jenkins-bot
35b74b4325 Merge "Use capital as first letter for class names" 2013-11-13 16:09:09 +00:00
jenkins-bot
a3358017b6 Merge changes I296d39be,I67bccf82
* changes:
  Use capital for classes Languages and ExtensionLanguages
  Break long lines
2013-11-13 16:05:53 +00:00
jenkins-bot
de91bb1e56 Merge changes I5d6baf6f,I2edfeaba
* changes:
  Don't use wfIsWindows() in CDB writers
  Clean up CDB classes
2013-11-13 07:52:09 +00:00
jeroendedauw
f8d274838a Fix location of variable initialization
Change-Id: I270ae60d2b92208f4700e5b5d94385031eb38eca
2013-11-12 19:36:21 +00:00
Siebrand Mazeland
fcddaf3e65 Use capital as first letter for class names
Searched extensions and there is a follow-up for Translate extension. Because class
names are not case-sensitive, this change is backwards-compatible.

Change-Id: Ice6c8beea4fba5c00278c063e4f6198294efabdc
2013-11-11 15:59:17 +00:00
Siebrand Mazeland
bd36998440 Use capital for classes Languages and ExtensionLanguages
Searched core and 600+ extensions for uses. Found no more.

Class names are case-insensitive anyway.

Change-Id: I296d39be9aa3a2690f80a23691b34394aa1c6637
2013-11-11 15:51:29 +00:00
Chad Horohoe
03c5605526 Clean up CDB classes
- Inheritance was a little funny, reduced some duplication
- Throw CdbException instead of plain MWException
- Abstracted wfDebug() to encourage reuse
- Declare visibility on a couple of public methods
- Move DBA implementations to their own file

Change-Id: I2edfeabaf62e39927abe869764ff2bd676821cd0
2013-11-08 17:19:50 -08:00
jenkins-bot
6834ae7504 Merge "Refactor diffs" 2013-11-09 01:18:08 +00:00
Siebrand Mazeland
7a95d47961 Address some PHP CodeSniffer errors and warnings
Change-Id: I495481e3532834f1f8a45cda9402d609de7e2bd7
2013-11-07 22:32:16 +01:00
Siebrand Mazeland
45de3c8057 Remove underscore from CdbReader_[DBA|PHP] classes and related file
Also gets rid of some CodeSniffer errors. There are more cases in core
(cache, pool counter, installer, database, load balancer, diff, CSS
Janus, less (argh!), media, parser, revdel, ...), that have class names
with underscores I'd be trying to get rid of later.

Change-Id: I33709c05e597978a5574a445fa43c583cbd7e12b
2013-11-07 13:16:56 -08:00
Siebrand Mazeland
6d2234640c Declare visibility on Autoloader::$autoloadLocalClassesLower
Make protected, add method to allow tests to clear the protected class
property, and remove a now unneeded class from the test.

Change-Id: I269cab8d3f4419c91dfe15d5722e19ff6da828d1
2013-11-07 09:41:47 -08:00
Tim Starling
e4bcbe722e Introduce includes/utils directory
These are classes that provide facilities for use by any caller, are
independent of user interface, and have a limited set of dependencies on
the rest of MediaWiki. See the README file for a more precise
definition.

These classes cannot go in includes/libs because of a dependency on the
MediaWiki framework, such as wfDebug() or MWException, but they are
otherwise similar. I thought it would be useful to put them in their own
directory, to make them more discoverable, and as part of a general
program of reducing clutter in the base includes/ directory.

I've probably missed a few classes which could be included here, but the
following classes were considered and were rejected for now:

* Fallback: single caller only
* GitInfo: getViewers() has inappropriate dependencies
* HttpFunctions: depends on configuration, $wgTitle
* PoolCounter: depends on configuration
* CacheHelper: depends on IContextSource, wfMemc()

Also moved a couple of classes into libs/ instead, where that seemed to
be more appropriate.

Change-Id: I274cff805b7d694b728a89b764a049cd62d320fe
2013-11-04 11:00:42 +11: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
Max Semenik
c37b4dc964 Refactor diffs
* Move some classes to separate files to avoid having a monstrous file with a
  dozen classes.
* Remove weird underscores from class names.
* Instead of prefixing members with underscores, specify visibility explicitly.
* Rename c_style -> camelCase per coding conventions.
* Throw exceptions instead of fataling out with trigger_error().
* Remove pointless constant used only once.

Change-Id: Icac23c0f6259c73f5fe07f201b83b9c332ba0469
2013-10-30 21:40:06 +04:00
Adam Roses Wight
7f51cf22f9 Minor optimization to the AutoLoader
When MediaWiki autoloading fails, we should gracefully return false.
Instead, we have been calling strtolower roughly 1,000 times in the hope
of finding a case-insensitive match.

This patch preserves the legacy case-insensitivity, but improves its
performance by approximately 100x, by storing the case-insensitive class
lookups as a static variable.

There is a new global $wgAutoloadAttemptLowercase which will switch the
behavior if desired.  The default is to support case-insensitive loading.

Change-Id: Ifb12e05614a48390b730167e9d4ddcd8545db764
2013-10-28 21:39:57 +00:00
Ori Livneh
9590795b91 Add 'RedisPubSubFeedEngine' feed engine
This patch adds a class which implements the RCFeedEngine interface by
publishing recent change notifications to Redis. The class handles the
'redis://' URI scheme. Recent changes are PUBLISHed to the channel 'rc'; a
different channel name may be specified as a path component.

Change-Id: I846036c091c45059a8947245a1efe92c9800dcf4
2013-10-21 17:22:00 +00:00
jenkins-bot
b67c7bc0d2 Merge "Remove proxy check in EditPage.php" 2013-10-21 01:17:52 +00:00
Kevin Israel
d7b953c25c Remove proxy check in EditPage.php
$wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath, and
$wgProxyMemcExpiry have been removed, along with the open proxy
scanner	script they were added for.

Bug: 54597
Change-Id: Id4c7521443f04995df3d8762d23629c18ada76f8
2013-10-21 01:12:47 +00:00
jenkins-bot
694df5e7ea Merge "Split changes list classes into separate files" 2013-10-19 14:41:22 +00:00
aude
761b880e98 Split changes list classes into separate files
Having them separate improves readability of the code
and makes it easier to work with this code.

Change-Id: Ic6aaf1ace3640f66ad41c2d85b4f7d740b259e0c
2013-10-19 14:26:27 +00:00
Tim Starling
00299ecb95 Resubmit "Add support for mysqli extension"
This reverts commit 1d7e12179d.

Change-Id: Id1a3fc34e94006b880f58de83e5e7c70b21d26ed
2013-10-17 01:35:28 +00:00
Tim Starling
1d7e12179d Revert "Add support for mysqli extension"
Throws exception unconditionally, installer support is totally broken.

This reverts commit b2d64432ee.

Change-Id: I2edb78440806754c42d48c5da2ff74b4cb40fa2d
2013-10-16 23:49:24 +00:00
Jakub Vrana
b2d64432ee Add support for mysqli extension
DatabaseBase::factory()'s parameter array now takes an optional
'driver' variable to allow specifying a specific driver for the
database class if we support more than one.

This is so we can gracefully support mysql/mysqli as the former is
deprecated, but the concept could be extended to other databases
as well.

Bug: 45288
Co-Author: Chad Horohoe <chadh@wikimedia.org>
Change-Id: I6733fe21c4aa7443e409c5dfa7c789552b2b62b7
2013-10-16 23:17:57 +00:00
jenkins-bot
3780115bac Merge "Add meta=filerepoinfo for getting file repo info" 2013-09-30 14:26:39 +00:00
Mark Holmquist
d94d29a920 Add meta=filerepoinfo for getting file repo info
We currently only return the image repository name for imageinfo, which
is not particularly useful, especially since image repositories aren't
accessible via the API. This patch adds meta=filerepoinfo, which will
return a list of repositories and relevant information (like the API URL
for ForeignAPIRepo ones)

Also returns the local repo now, and defaults to "all" in a more useful
fashion.

Change-Id: I1aaed0895d2a0bc224c82e93975ecf6afd8cb6b8
2013-09-27 13:53:34 -07:00
Brion Vibber
006f136e79 Move LESS function definitions from DefaultSettings to ResourceLoaderLESSFunctions.php
Intermittent error in production from top-level lambda functions:
https://bugs.php.net/bug.php?id=52144

Change-Id: I9785a601fd5d57c9d8d84b90ee29eef61a6f2e77
2013-09-26 15:57:50 -07:00
Brion VIBBER
0dc6d85c0b Merge "Support LESS stylesheets in ResourceLoader" 2013-09-23 19:59:49 +00:00
Ori Livneh
b67b9e1b48 Support LESS stylesheets in ResourceLoader
This patch adds support for the LESS stylesheet language to ResourceLoader.
LESS is a stylesheet language that compiles into CSS. The patch includes
lessphp, a LESS compiler implemented in PHP. The rationale for choosing LESS is
explained in a MediaWiki RFC which accompanies this patch, available at
<https://www.mediawiki.org/wiki/Requests_for_comment/LESS>.

LESS support is provided for ResourceLoader file modules. It is triggered by
the presence of the '.less' extension in stylesheet filenames. LESS files are
compiled by lessc, and the resultant CSS is subjected to the standard set of
transformations (CSSJanus & CSSMin). The immediate result of LESS compilation
is encoded as an array, which includes the list of LESS files that were
compiled and their mtimes. This array is cached. Cache invalidation is
performed by comparing the cached mtimes with the mtimes of the files on disk.
If the compiler itself throws an exception, ResourceLoader constructs a
compilation result which consists of the error message encoded as a CSS
comment. Failed compilation results are cached too, but with an expiration time
of five minutes. The expiration time is required because the full list of
referenced files is not known.

Three configuration variables configure the global environment for LESS
modules: $wgResourceLoaderLESSVars, $wgResourceLoaderLESSFunctions, and
$wgResourceLoaderLESSImportPaths. $wgResourceLoaderLESSVars maps variable names
to CSS values, specified as strings. Variables declared in this array are
available in all LESS files. $wgResourceLoaderLESSFunctions is similar, except
it maps custom function names to PHP callables. These functions can be called
from within LESS to transform values. Read more about custom functions at
<http://leafo.net/lessphp/docs/#custom_functions>. Finally,
$wgResourceLoaderLESSImportPaths specifies file system paths in addition to the
current module's path where the LESS compiler should look up files referenced
in @import statements.

The issue of handling of /* @embed */ and /* @noflip */ annotations is left
unresolved. Earlier versions of this patch included an @embed analog
implemented as a LESS custom function, but there was enough ambiguity about
whether the strategy it took was optimal to merit discussing it in a separate,
follow-up patch.

Bug: 40964
Change-Id: Id052a04dd2f76a1f4aef39fbd454bd67f5fd282f
2013-09-23 12:55:19 -07:00
Max Semenik
19627682ac Move HtmlFormatter from MobileFrontend
This class is needed by CirrusSearch, another application will be API
prop=extracts which doesn't really belong to MobileFrontend and will also
be integrated into core soon.

Change-Id: Ic276e1604c5718e8568e120ddfb9a8fc13a682fc
2013-09-20 11:52:46 -07:00
kaldari
e517e9be57 Removing all disambiguation code from core
Disambiguation related functions have been re-implemented in the
Disambiguator extension.

Bug: 35981
Change-Id: I4afa30bf2677c6541ef355013f8eaef46abfbe03
Dependency: I41637ea43a9e5000bcb8a782441ce36f1068881f
2013-09-05 14:07:51 -07:00
bsitu
04a1021425 Add a deferrable update class for callback/closure udpates
Change-Id: Ifdf2a0937df50eb2f04d514b5cc2ef39a54ebe8f
2013-09-03 23:15:36 -07:00
Brian Wolff
2dd30d0c6d Allow listing old files in Special:ListFiles. Add Special:AllMyUploads
This solves the problem of new users on commons wanting a list of
their files, but something like cropbot modifying it and taking
it off Special:MyUploads.

I'm worried this is a bit hacky to make TablePager work with
two queries. If anyone has any suggestions on how to do this
in a less hacky way, please say.

Some notes:
* This totally removes any revdeleted entries instead
  of dealing with them. Some future iteration can do selective
  deletion.
* Should maybe add links to old versions of files description
  page somewhere. Not sure where in ui that would fit (The date maybe)
  (by old file description page I mean something like flagged revs
  filetimestamp parameter)
* The latest version column should perhaps have "latest" and "old"
  instead of "yes" or "no"
* This is slightly different from the suggestion on the bug report
  as it shows all revisions (instead of say just first revisions).
  I think showing all revisions makes more sense for the "where
  are my uploads" use case. Second of all, the checkbox is not on
  by default.

Bug: 30607
Change-Id: I9e58db1f212e3bb361316c05ef32d4b9c31c6490
2013-08-28 21:42:05 +02:00
Victor Vasiliev
2961884b43 Provide a JSON recent changes feed.
This introduces a new configuration variable, $wgRCFeeds, which allows the user
to configure multiple destinations for RC notifications. It also allows the
notification format to be customized. Two formats are included by default: the
older IRC format and a new JSON format.

Change-Id: I270bde418a82985c94372ac4579100435b6ee026
2013-08-25 21:23:16 -07:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
Brian Wolff
14b3f8767b New more slick gallery display
This extension adds a "mode" parameter to the gallery
tag, allowing different formats for the gallery tag
(galleries in the ui can be controlled by a global)
The added modes are:
*traditional - The original gallery
*nolines - Like the original, no borders, less padding
*packed - All images aligned by having same height.
  JS also justifies the images.
  (I think this one is the one that will go over best
  with users.)
*packed-overlay - like packed, but caption goes over
  top the image in a transloucent box.
*packed-hover - like packed-overlay, but caption only
  visible on hover. Degrades gracefully on screen
  readers, and falls back to packed-overlay if
  you are using a touch screen. I kind of like
  this mode when the caption is not that important
  (ex a category where its just the file name).

This also adds a hook to allow people to make their
own gallery version. I believe there would be interest
in this, as different people have done different
experiments. For example:
* Wikia: http://community.wikia.com/wiki/Help:Galleries,_Slideshows,_and_Sliders/wikitext
* Wikinews: https://en.wikinews.org/wiki/Template:Picture_select

What I would like to see for this patch, is first it gets
enabled, with the default still "traditional". After
about a month or two we consult with users. If feedback
is positive, we change the default mode to one of the
others (probably "packed").

Adds a "mode" parameter to gallery for different
mode, including one 'height-constrained-overlay'
which looks much more like other modern websites.

Note: This makes one change to the old gallery format.
It makes Nonexistent files be rendered like thumbnails
(i.e. they are rendered with a little grey border).

One thing I'm slightly worried about with this patch,
is that I added an option to MediaTransformOutput::toHtml
to override the width attribute. I'm not sure if that
is the best approach, and would appreciate thoughts
on that.

This should be merged at the same time as Ie82c1548

Change-Id: I33462a8b52502ed76aeb163b66e3704c8618ba23
2013-08-14 20:56:05 -03:00
Aaron Schulz
450e9c3258 jobqueue: cleaned up JobQueue exception handling
* Added JobQueueError exceptions.
* Periodic tasks that fail are logged and skipped.
* JobQueueFederated properly fails over now.

Change-Id: I9d9f0dae548a9dde693a7cd25c255a8bfbf37899
2013-08-13 02:37:35 +00:00
Brian Wolff
ed1c89b884 Add Special:RandomInCategory.
The method used is quite biased, but I believe its the best
possible without a schema change and still being efficient.
I think it is good enough for many of the use cases that
need different articles to pop up, but not "real" randomness.

The method used
is to chose a random timestamp and look at cl_timestamp. This method
will give good results if the timestamps are uniformly distributed
(which probably is not usually true). I think it may give acceptable
results in general, especially given most people are not interested
in true randomness, but more in "give me a result I haven't seen before".
(For example, to pick a random entry in a maintenance category to clean
up).

It also fudges the result a little bit using offset to stop really
biased results from happening. This is mostly meant to stop a
category with an extremely clumped distributed from returning
the exact same article every time. It is not meant to generally
increase randomness.

Bug: 25931
Change-Id: I0c48e4a236b50fb627af94f0df47fef8372ea14d
2013-08-01 10:33:04 -07:00
MatmaRex
ed7979a970 Refactor watchlist token handling
Do not allow the user to change it directly; instead create a form
where they can reset it. (The token can still be changed via the API.)
The token is autogenerated whenever it is shown or otherwise used.

This really should have never used the preferences; however, trying to
change that now would be lots of work for very little gain, so this
keeps using that mechanism, adding a little abstraction over it.

It's not unconceivable that similar tokens could be used for other
pieces of data, like Echo's notifications; this enables that with one
new hook.

----

Things done here:

* Add getTokenFromOption() and resetTokenFromOption() methods to User,
  abstracting out the get-and-generate-if-empty process of handling
  tokens. Respect $wgHiddenPrefs (Watchlist didn't do that
  previously).

* Create Special:ResetTokens, inspired by Special:Preferences and
  Special:ChangeEmail, presenting the token resetting interface
  (HTMLForm-based with CSRF protection).

* Create a new hook, SpecialResetTokensTokens, allowing extensions to
  register tokens to be shown in the resetting form. Each token needs
  information about the preference it corresponds to and a short
  description (used for checkbox label).

* Hide the preference on Special:Preferences (use type=api to achieve
  this), display a link to aforementioned special page instead. Move
  info blurb to its own section at the bottom.

Bug: 21912
Change-Id: I0bdd2469972c4af81bfb480e9dde58cdd14c67a8
2013-07-24 22:06:15 +02:00
Aaron Schulz
1fbb0404f5 Allow for IDatabase to be used as type hints for DatabaseBase|DBConnRef
* Use this in LogEntry to avoid needless type errors

Change-Id: I8644b35b0d9cd171243dd28de52e94ef39d361a7
2013-07-18 03:43:20 +00:00
Aaron Schulz
d921b2fd7e database: added DBConnRef wrapper to manage calling reuseConnection()
Change-Id: Ifc9db62d1ac34d0c6a072d6f2d05bdcf73af14bb
2013-07-15 15:10:45 -07:00
Aaron Schulz
c61d48f87e Stop spamming exception log with random upload stash failures
* Things like authorization and validation problems do not belong in the
  exception log.

Change-Id: I3c4c1bab65cfe9111dc2161bda6d023234112900
2013-06-25 16:10:42 -07:00
Chad Horohoe
84528e2c8b Remove unused class, SearchUpdate is backend-agnostic
Change-Id: I8c91c28ff2bde361490691b4abc107329f0d8194
2013-06-19 16:10:06 -04:00
jenkins-bot
9815539fae Merge "filebackend: throw exceptions during file iteration." 2013-06-19 19:57:32 +00:00
jenkins-bot
8a9576ab5a Merge "Only new vertical format login and signup forms" 2013-06-19 09:13:31 +00:00
S Page
44840d1592 Only new vertical format login and signup forms
* The "VForm" templates replace existing templates.
* Remove useNew switch logic and $wgUseVForm{UserLogin,CreateAccount}.
* The CSS and JS files for forms lose the .vform qualifier, except for
  the CSS for styling vform elements.
* Merge tiny mediawiki.special.userLogin.signup.js into createAccount.js.
* Remove replaced and obsolete messages (see
  https://www.mediawiki.org/wiki/Account_creation_user_experience/Strings
  for details), and remove mention of "new" forms and useNew from
  MessagesQqq.php.

Bug: 46333
Change-Id: I50f25583c3aa9a4a263fb40f50256f92c18ddb4d
2013-06-17 23:29:50 -07:00
Aaron Schulz
754b8babca filebackend: throw exceptions during file iteration.
* This lets calling code be far more robust rather than just
  silently ignoring entries due to some temporary problem.

Change-Id: I3ce2ae34f6cff5e40a80b8da5688503a387ce2a6
2013-06-15 23:01:47 -07:00
Jakub Vrana
b1cc3511fd Prepare DatabaseMysql for mysqli
PHP extensions mysql and mysqli have lots in common.
In order to support mysqli, this diff separates common MySQL behavior to abstract class DatabaseMysqlBase and implements the mysql-extension specific in DatabaseMysql.
Outside behavior remains the same.

I've tried to minimize future code duplication by introducing mysql*() methods even if the parent method just unwraps the result.

Bug: 45288
Change-Id: I905d4a4550377bc849a860f0962dad710d9dc71f
2013-06-12 23:44:24 +00:00
Daniel Friesen
ed6e876688 Drop __autoload.
spl_autoload_register exists in >=5.1.2, we require >=5.3.2
We no longer support hphpc and it looks like hhvm supports spl_autoload_register

We've got no reason to keep using __autoload.
We'll also need to exclusively use spl_autoload_register when we start using composer.json stuff.

Change-Id: I694b7b96825e5d136fa76461511efc9a002149fa
2013-06-11 00:21:42 +00:00
Aaron Schulz
3bc539e1af Moved job queue aggregator classes to a subdirectory.
Change-Id: Iabbf566b05d44e19770db7b4519abfe00e4a8d90
2013-05-27 14:14:29 +00:00
csteipp
4233341283 SECURITY: Do checks on all upload types
Also, verify file before stashing it

Change-Id: Ib2474cb778d53959a4f479e53d0392f916b18d83
2013-05-21 13:20:06 -07:00
Antoine Musso
ea14e46965 autoloader missed some entries
Jenkins does not run the autoloader test (will be fixed in a different
commit).  This patch fix the main and test autoloader to add in all the
missing entries.

bug: 47750
Change-Id: I285fa7ed24a6fc45a4dc475b54d80cf3816436fb
2013-05-21 11:56:26 +02: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
jenkins-bot
afd141c543 Merge "Remove Parser_LinkHooks and CoreLinkFunctions classes" 2013-05-08 19:56:11 +00:00
Chad Horohoe
a6d2365015 Revert "Remove Special:ActiveUsers"
This reverts commit 27104686ab.

Revert "Remove link to Special:ActiveUsers from Special:Statistics"

This reverts commit 62949af09e.

I used a sledgehammer where a scalpel would've done--and I should
be whacked with the cluebat. This should be done per-wiki, plus
improvements.

Change-Id: Ib43b42057b8d9f714a8a71ba9cbe375385254b7c
2013-05-05 23:14:21 +00:00
Reedy
612afc2533 Remove Parser_LinkHooks and CoreLinkFunctions classes
Bug: 45371
Change-Id: I06f890153df0cb8f4fb84a73a06a6f5f4817cf3b
2013-05-02 16:43:39 +01:00
jenkins-bot
85e881945d Merge "Create a Special:Redirect page." 2013-04-30 18:34:11 +00:00
C. Scott Ananian
2849d8a6b3 Create a Special:Redirect page.
The primary purpose of this page is to redirect to a user page given a
numeric id.  The numeric User ID is stable across renames, and is
therefore an appropriate primary key for identifying the user
associated with a given revision.  The Parsoid API would like to
export semantic RDFa in its DOM identifying the author of a revision
by their userid, but in order to do so requires a MW redirect from
userid to the appropriate User page.  (A "permalink" for the user.)

This patch adds that redirect, as
  http://somewiki/Special:Redirect/user/1234

(https://bugzilla.wikimedia.org/show_bug.cgi?id=45206 is the related
Parsoid feature.)

Rather than adding a set of ad-hoc redirection pages, this patch
sets up an infrastructure for redirections.  Special:Redirect also
subsumes the functions of:

* Special:Filepath (Special:Redirect/file/xxxx)
* Special:PermanentLink (Special:Redirect/revision/xxxxx)

This structure is extensible for other redirect types.

Change-Id: I8b0785f4fbdb3dd438a7a45263c5f375ff9d2208
2013-04-30 13:40:54 -04:00
Aaron Schulz
32ac151803 Created ProfileSection class to avoid wfProfileOut() whack-a-mole.
Change-Id: I9f7e0638edd99e1ac07b83054e8f7ef255179281
2013-04-28 23:54:33 +00:00
Matthew Flaschen
af7b20570c Create account form with vertical form appearance
Similar to the login form (change 55847), this presents a compact
vertically-stacked form, if a global variable is set or if you add
?useNew=1 to the query string.

The redesigned create account form also:

* Removes the remember me checkbox (see bugzilla 47267)
* Displays some wiki statistics in a benefits column.
* Repositions the FancyCaptcha image if present using JavaScript (see
  bugzilla 47372).
* Sets the template skin as in change 59577.

Bug: 44628
Bug: 47267
Change-Id: I9b03d519af43de147bff0ac509a1154f67cd3a0a
2013-04-23 15:56:02 -07:00
Alexandre Emsenhuber
98a22b0b58 Update AutoLoader
- Move files in includes/externalstore to their own location for consistency
- Order MWCryptRand alphabetically
- Add missing HTMLButtonField

Change-Id: Ib3798dce6080960df68badd6237968a33473e36b
2013-04-23 16:48:24 +02:00
Aaron Schulz
b41a2f8f68 Moved CryptRand.php to MWCryptRand.php
Change-Id: I03e3742f270ccf05ea923a46e8f8171e6f73ffcd
2013-04-23 11:39:39 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
Aaron Schulz
fc81192a06 [JobQueue] Added JobQueueFederated class for partitioned queues.
* This lets queues be horizontally partitioned onto
  different servers, with weights assigned to each.
  The queue classes used by the different partitions
  can be hetereogenous or homogeneous.
* How partitioning is done is setup similar to LBFactory,
  where wikis belong to sections and sections have config.

Change-Id: I44d59b67cf417dca28a3e9b25371dac5a7ffcb47
2013-04-19 03:27:15 +00:00
Aaron Schulz
ed01e81359 [LockManager] Added a RedisLockManager class.
Change-Id: I7ade74eb307a5075533f36836768af60f106a6b9
2013-04-18 20:18:54 -07:00
jenkins-bot
dfd1efa0f4 Merge "Revised design of Special:Userlogin" 2013-04-11 23:31:51 +00:00
S Page
b809d516db Revised design of Special:Userlogin
If a global variable is set or if you add ?useNew=1 to the query string,
Special:Userlogin loads a different login template (UserloginVForm.php)
with the new Vertical Form appearance and different messaging.
Otherwise the current unchanged template renders so that wikis can cut
over to the new look when ready (with messages and links). Once they do
so, the variable and flag will be retired.

The new template applies mw-ui-vform and mw-ui-button styles defined in
a new 'mediawiki.ui' CSS module in core to create a compact vertical
form.  The mw-ui styles specify a Helvetica font stack (that we tested
in the Account creation experiment) in the form area, but NOT if the
user is using some other skin than Vector.

The CSS code is developed using Sass. The patch includes the
Sass scss files, along with a Makefile that uses their Compass build
configuration (config.rb).

The redesigned Special:Userlogin also:

* Displays a "secure login" link if HTTPS is available.
* Loads additional CSS for its form features (e.g. more attractive
  errorbox, "Join wiki" messaging).
* Defines new "userlogin-xx" messages; many are the same as
  existing messages but without ':' on the end.
* Uses a distinct title for Login instead of generic "Log in /
  Create account".
* Removes the [mailmypassword] code branch from its login template as it
  is never executed.

Bug: 44628
Change-Id: I489042c50aa060c90ca18b05097dbe25c4ae6395
2013-04-11 22:26:45 +00:00
Aaron Schulz
4c54454be4 Moved ChronologyProtector to its own file.
Change-Id: I01bf0206322454e36633921887d10356a48ab5cb
2013-04-11 14:08:45 -07:00
Chad Horohoe
4be6236352 Remove externaledit/externaldiff preference
Change-Id: Ic3791d188688f556753ab5556a4d9733bbf2e85e
2013-04-11 09:20:36 -04:00
Chad Horohoe
36cade5fe8 Remove ExternalUser authentication code
This was an experimental authentication system intoduced a couple
of years ago with a pretty narrow use-case. It's been pretty much
ignored since introduction, and makes login more complicated than
it needs to be.

I didn't drop the external_user table on the off-chance someone
out there actually has data in it, but they should use AuthPlugin
for their external authentication needs.

Change-Id: I794338dbb75961ee033d41fa44bb7aa22e54f447
2013-04-04 10:09:34 -04:00
Chad Horohoe
8dfd474b53 Remove several ancient skins
Standard, Simple, Chick and MySkin have all been removed.
Nostalgia has been moved to an extension for posterity.

Change-Id: Ia6d73c2deb9428d214b7d69b29235094de75c52e
2013-04-01 17:11:59 -04:00
Aaron Schulz
5f1e95436e Avoid sending multiple UDP packets for the same key in wfIncrStats().
* This should help reduce collector data loss.

Change-Id: Ibe55648422d1b8aac86dd6fa83973d3c8715b0aa
2013-03-29 12:01:42 -07:00
Kevin Israel
79f80cc495 Combine JavaScript and JSON encoding logic
This will help with improving human readability of JS and JSON
objects encoded by both ResourceLoader and the API. This patch
also adds new "utf8" parameter to the JSON formatter of the API.

Changes to FormatJson class:

* Added escaping of '<', '>', and '&' by default to protect against XSS.
* Removed unnecessary escaping of '/' and added an additional option to
  unescape non-ASCII characters (those above U+007F) as well.
* Added PHP 5.3 pretty printing code (to replace Services_JSON) that
  uses a four-space indent as PHP 5.4 does.

Changes to Xml class:

* Defined Xml::encodeJsVar() in terms of FormatJson::encode()
  and added a pretty printing option. Also added a pretty printing
  option to Xml::encodeJsCall() as well.
* Deprecated Xml::escapeJsString() and QuickTemplate::jstext();
  callers have to add quotes themselves, hence the escaping of
  both double quotes and apostrophes.

Bug: 26818
Change-Id: I1987190f1ba5bf41738e7bd611209706c1f6bb5c
2013-03-27 20:22:45 -04:00
jenkins-bot
6ad44a315a Merge "Move subclasses of LogFormatter to their own file" 2013-03-26 08:38:04 +00:00
Chad Horohoe
27104686ab Remove Special:ActiveUsers
This feature was poorly thought out from the start. It's a huge
performance drain when used, for a mimimally useful set of data

Change-Id: I138622e1c184f74e2a7ce13a9a544ab4e610d7a0
2013-03-25 18:19:21 -04:00
Aaron Schulz
1575b24f59 Added a PoolCounterWorkViaCallback convenience class.
Change-Id: I1cbb2cc8a43eea2d28f38cfd2d3a4908dc7d0da9
2013-03-19 23:25:40 -07:00
Alexandre Emsenhuber
744c0c7541 Move subclasses of LogFormatter to their own file
Except LegacyLogFormatter.

includes/logging/LogFormatter.php is getting bigger and bigger with
the addition of new formatters when logs are changed to use them
instead of the old method, so better doing this now before we get
new formatters for remaining log types.

Change-Id: I6aab19c8d68bf47beddad42632b0360a7b12f251
2013-03-15 15:25:33 +01: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
Aaron Schulz
5cfcb3053d [JobQueue] Added JobQueue::getAllQueuedJobs() function.
* Also added a small MappedIterator class for convenience.

Change-Id: I7dac1001a8e048cb524f7fbfee50a20a32e598ba
2013-03-08 06:34:31 +00:00
Jan Gerber
e288e4036c (bug 33186) image rotate api
add api action imagerotate to rotate images.
	rotations are stored as a new version of the image.

Change-Id: Id15a92d19cda8256917e7e1e5ee4241012214102
2013-03-07 21:38:10 +00: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
jenkins-bot
636d0de4b8 Merge "Adding new subclass to HTMLForm for constructing a checkbox matrix" 2013-03-05 20:09:21 +00:00
jenkins-bot
7027ba7e93 Merge "Remove DB2 support" 2013-03-01 22:00:46 +00:00
Reedy
6f3e4e9806 Kill off and remove HttpRequest class
Change-Id: I0661d483c60fc0d32f0c51937e91bece6960dfcf
2013-02-28 01:45:54 +00:00
Kaldari
043b6b32f6 Adding new subclass to HTMLForm for constructing a checkbox matrix
Also adding corresponding support for using them within preferences

Change-Id: Ie6e77dfd8edaff212655d0be1d048a10eeba341f
2013-02-27 11:56:31 -08:00
jenkins-bot
96eb68f39f Merge "[Upload] Moved async upload stuff to the job queue." 2013-02-26 23:58:32 +00:00
MatmaRex
0c28ca1422 Revert "(bug 29788) Swedish Collation (uppercase-sv). Swaps Ä and Æ"
This workaround is unnecessary now that I838484b9 was merged.

This reverts commit 13dc8ff88f.

Change-Id: I2cd22ad87eb7a56c5742b20c6089a4b8607e5614
2013-02-26 22:18:36 +00:00
Brad Jorsch
307ac55e50 Add PagesWithProp special page and API module
It would be useful to be able to list pages using a particular page
property, particularly in light of the new Disambiguator extension.

This adds a special page Special:PagesWithProp and an API query module
list=pageswithprop to do just this. It also adds an API query module
list=pagepropnames to list the prop names currently in use on the wiki.

Change-Id: Ib0d4e17f22b8d0cb9894eac6095962315480e809
2013-02-26 00:24:31 +00:00
Chad Horohoe
6f4448dd71 Remove DB2 support
Change-Id: I9b294a213a4000f503c0010d88757db6dda927c0
2013-02-25 13:47:03 -08:00
Aaron Schulz
d0985f4f04 [JobQueue] Added aggregate empty/non-empty queue caching.
* The default class is JobQueueAggregatorMemc.
  This essentially has the logic that nextJobDB.php used.
* Also created a JobQueueAggregatorRedis class.
  This is much more efficient and more responsive.
* This can speed up calls to getQueuesWithJobs().
* Removed unused getDefaultQueuesWithJobs() function.

Change-Id: Ifb3c6c881decd643da1b662956ded69db4b39431
2013-02-20 17:34:14 -08:00
Aaron Schulz
fbf34d84ab [Upload] Moved async upload stuff to the job queue.
* (bug 44080) Also carry-over the IP and HTTP header info.
* This adds a RequestContext::importScopedSession() function.

Change-Id: Ie9c0a4d78fb719569c8149b9cc8a5430f0ac5673
2013-02-15 15:00:35 -08:00
Aaron Schulz
fdef79d9f2 [LockManager] Created PostgreSqlLockManager class.
* Made DBLockManager abstract instead of a hacky blocking implementation.
  With a PG and MySQL option, that option is no longer useful.

Change-Id: I939551bd2283608f2d017d9d2fca1334a533c005
2013-02-15 04:06:10 +00:00
Tim Starling
f96e5c5eec Merge "[JobQueue] Added a JobQueueRedis class." 2013-02-08 05:01:34 +00:00
Aaron Schulz
0beb6f9832 [ExternalStore] Added ExternalStoreMwstore class that uses a file backend.
Change-Id: I7785a621fe32f549b2e7c636f2b6e7b18be367f4
2013-02-07 09:52:03 -08:00
Aaron Schulz
e53902e550 Added UIDGenerator class for getting statistically unique IDs.
* This is useful for making IDs for object in partitioned stores.
* The "UID" functions are not called "UUIDs" since they don't follow RFC4122.
  This is for performance reasons since the ID fields tend to be indexed.
* This includes newUUIDv4(), which is compliant with the aforementioned RFC.

This reverts commit 86f895bfe3.

Change-Id: I989626dfb7976d17f5931a34fe040f41cf14dfe3
2013-02-07 17:38:12 +00:00
Tim Starling
53cd876eb4 Remove Preprocessor_HipHop
To reduce the maintenance burden for changes such as Id7ec4e69. The
project to optimise the preprocessor for hiphop is incomplete and is not
especially useful given the present state of hiphop support.

Change-Id: Iebcfe4d40f74520e29e7feb522251892fab2f652
2013-02-06 14:44:10 +11:00
Brian Wolff
13dc8ff88f (bug 29788) Swedish Collation (uppercase-sv). Swaps Ä and Æ
See I4542f57a. Meant as a temporary meassure until such a time
generic tailoring code is implemented for uca. This patch
is mostly Lejonel's code, with the class renamed.

Change-Id: Id39406c37a5277d9e7a9216544de2140411c2b01
2013-02-05 22:21:50 +00:00
Yuri Astrakhan
a97bb3acfa API module manager and help rewrite
This is a non-versioned part of the larger patch #41014
https://gerrit.wikimedia.org/r/#/c/41014
It will allow help subsystem optimization (merging paraminfo and help),
path towards per-module or per-system versioning, removal of the
manually maintained generator lists.

Changes:
* ApiModuleManager now handles all submodules (actions,props,lists) and instantiation
* ApiModuleManager maintains a cache of all instantiated modules
* Query stores prop/list/meta as submodules
* action=help suports generalized submodules (modules=query+value), querymodules obsolete

Change-Id: Ie2dee41e44a29cd5d5935eeaa5240b708d95a8f0
2013-02-05 01:52:55 -05:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Aaron Schulz
7224c402ca [LockManager] Split QuorumLockManager into its own file.
Change-Id: Ib487a39b04ac9de3449695ac388c95ae45933469
2013-01-31 22:29:44 -08:00
Aaron Schulz
a37f67909f [ExternalStore] Refactored external store classes to use a base class.
* Added ExternalStoreMedium base class
* Moved up two functions in ExternalStoreDB
* Various documentation tweaks

Change-Id: I6790aab7799609422e7af4fb31d2ad60610298ec
2013-01-25 15:54:15 -08:00
Aaron Schulz
03833b54e8 [JobQueue] Added a JobQueueRedis class.
* The Job class now includes an extra "metadata" field now for usage
  by the queue classes. This is useful for stores that lack IDs.
* A RedisConnectionPool class was added for reusability.

Change-Id: Ie72536240e27fe1caf11096cdc4c85dfa821d181
2013-01-22 11:09:58 -08:00
jeroendedauw
a00337c3f8 Design improvements to sites code
Change-Id: I08ffa6a97093abbe85169f664b97498c5f39bf8e
2013-01-22 15:39:23 +01:00