Commit graph

1159 commits

Author SHA1 Message Date
Chad Horohoe
da6e284638 Remove AutoLoader::loadClass()
A poor design decision if I ever made one. Luckily nobody uses it.

Change-Id: Ia6482cce2e17046346c1f8ea196f9510008faebd
2016-07-22 10:29:02 -07:00
jenkins-bot
9ba3fca2d8 Merge "Remove fix for a 5.3 problem" 2016-02-29 14:46:40 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Max Semenik
014a5f35f3 Remove fix for a 5.3 problem
Change-Id: Icafe66793a4e91aa0461c13987f73c692b2926d0
2016-02-11 15:02:58 -08:00
Timo Tijhof
6a0d8892bc autoloader: Remove incorrect documentation comment
Follows-up I8b1bdb84a969. This is not generated by that script,
the autoload.php file is, but that one has a similar comment
in it already.

Change-Id: Icb44f3dab356820f1e3aa5ba56949219af1b5719
2014-12-19 06:02:34 +00:00
Erik Bernhardson
396a76f2ff Generate $wgAutoloadLocalClasses with a maint script
Currently all new classes in core need to be registered
with the autoloader.  This is acceptable but inconvenient.

This patch adds a script to read the output of php's tokenizer
to determine the names of all the classes within mediawiki core.
Patches with new or removed classes will just need to rerun
the maint script rather than manually adjusting the arrays.

A full conversion to psr-0 + composer would solve this as well,
but this is a very non-intrusive patch that can get us some
portion of the benefit(reduced manual maintenance) today rather
than months down the line once we figure out all the intricacies
of mediawiki + composer.

Change-Id: I8b1bdb84a9699de79f8b9951fa61e5437d083c55
2014-11-13 15:41:31 -08:00
Aaron Schulz
0bfa6b6264 Move request-only template profiling to an always-on parser report
Change-Id: I0660c8d6cac0dadab648eac9736504b7939320f3
2014-11-12 18:06:00 -08:00
jenkins-bot
0e2a9baff3 Merge "Enable profiling via xhprof" 2014-11-12 22:00:30 +00:00
Aaron Schulz
93d2167ca6 Moved MapCacheLRU to libs/
Change-Id: Icb820787afe7298dd3124f5168d3efff19e53ab6
2014-11-10 22:51:29 +00:00
Kunal Mehta
fb54343d6f cdb: One class per file
Change-Id: I18c6f58d8b3747c4da9d74884a3c9a3571f403f3
2014-11-10 19:05:34 +00:00
Kunal Mehta
102fc2ac7b Move Cdb classes into includes/libs/cdb/
Change-Id: I2c4fa605acf5e0cf1fdd4821fe6bcdd690b02759
2014-11-10 10:42:30 -08:00
Aaron Schulz
db5d7a807f Removed incomplete/unused DatabaseType interface
Change-Id: I95b64f0a74f0203092464c4900fef2ac97e3ba35
2014-11-09 22:56:23 -08:00
Bryan Davis
46c47e11bc Enable profiling via xhprof
Add a helper class to assist in collecting profiling information using
XHProf <https://github.com/phacility/xhprof> and a Profiler
implementation to hook it into the existing MediaWiki profiling system.

The Profiler includes support for generating tabular reports similar to
the traditional output of ProfilerSimpleText and ProfilerSimpleTrace or
sending data to a udpprofile daemon as supported by ProfilerSimpleUDP.
It also produces data compatible with the debugging toolbar.

Bug: T759
Change-Id: I16a75cb7636cb5dcef3830d738b2dcd2047d0aaa
2014-11-08 11:47:25 -07:00
Chad Horohoe
519fd863aa Move Cookie(Jar) to libs/
This doesn't rely on any other parts of MediaWiki since we can
replace MWException with InvalidArgumentException here.

Change-Id: Id4512b184d24efc6674d486a5d452aa44dc871c6
2014-11-06 18:12:51 +00:00
Kunal Mehta
e1bd68f032 Move ArrayUtils into libs/ as there is nothing tying it to MediaWiki
Change-Id: I6910c85279858895f5462324134bade580a0cae7
2014-11-06 16:17:23 +00:00
Kunal Mehta
5357441fd3 Use CSSJanus via composer
Requires I7de49f443 in mediawiki/vendor

Change-Id: I94837938f0e0f3daa4d1f53c390457f843000605
2014-11-05 21:03:26 +00:00
Chad Horohoe
4e61f1bb8b Profiler code cleanup
- Put Profiler, ProfileSection and TransactionProfiler in their own
  files and rely on Autoloader to use them (maintenance has been
  using the autoloader here for some time--we don't profile the
  autoloader manually)
- This reduces overhead in WebStart/doMaintenance by only loading
  three functions at profiler initialization and defers until the
  first profiling call happens
- Inline callback functions in ProfilerSimpleText rather than having
  public static functions.
- Small comment and code formatting changes in various touched files.

Change-Id: Idf27677c068c50b847152c523a33e7f0c33fdeeb
2014-11-04 21:14:51 +00:00
Brad Jorsch
991de897e4 API: Split list=deletedrevs into prop=deletedrevisions and list=alldeletedrevisions
list=deletedrevs has always been an odd one: it pretends to be a prop
module sometimes in taking titles from ApiPageSet, but when the pageset
supplies no titles it acts like a list module. This causes problems
such as bug 71389, and makes the whole thing unnecessarily confusing.

The solution is to split the "prop" and "list" aspects into separate
modules: prop=deletedrevisions when input should come from ApiPageSet
and list=alldeletedrevisions when not.

At the same time, let's take advantage of the situation to clear up some
other bugs. And let's share the revision-formatting code with
ApiQueryRevisions instead of partially reimplementing it.

Bug: 23489
Bug: 27193
Bug: 44190
Bug: 71396
Bug: 71389
Change-Id: I3e960d5c655bc57885d6d4ee227e67104808add7
2014-11-04 15:02:03 -05:00
Chad Horohoe
efd2fcc575 Remove ProfileMwprof
An interesting experiment, but it was never completely fleshed out
and represents an anti-pattern as the only class that doesn't follow
the Profiler -> ProfilerStandard inheritance.

Since we want to refactor this to split profiling and profiling output
we need this unused but difficult to refactor code gone.

Maybe in the future after things are refactored and someone has the
time or inclination this could be dusted off again.

Change-Id: I1fd8813894e1fe88652b0c17b5ad8f42666bf776
2014-10-30 22:20:45 +00:00
Bryan Davis
28a7ce420b Use MWLogger logging for legacy logging methods
Send wfDebug, wfDebugLog, wfLogDBError and wfLogDBError log messages to
the new MWLogger PSR-3 logger subsystem. Compatibility with the historic
logging operations of wfLogDBError are provided by MWLoggerLegacyLogger
and the MWLoggerLegacySpi logger factory.

Requires the MWLogger system introduced in I5c82299 and the Composer
managed libraries from Ie667944.

Change-Id: I1e5596d590144fbfdfd5f18bc42cf1ef0dbcac12
2014-10-29 11:55:08 -07:00
jenkins-bot
752df151c6 Merge "Make $wgMWLoggerDefaultSpi more expressive" 2014-10-27 17:08:04 +00:00
Bryan Davis
51b37035b3 Make $wgMWLoggerDefaultSpi more expressive
Allow $wgMWLoggerDefaultSpi to specify a more expressive object creation
by introducing a new ObjectFactory class which can process an array of
instructions to call either an object constructor or a factory method
with an array of arguments. This allows removal of the
$wgMWLoggerMonologSpiConfig global variable in favor of configuration
using $wgMWLoggerDefaultSpi.

New classes introduced:
; ObjectFactory
: Construct objects from configuration instructions.

Change-Id: If56cce5dcb1ad5712e238d6e2dab809a351f79be
2014-10-25 16:00:06 -06:00
Bryan Davis
982143bf4f Remove invalid CacheHelper entry from wgAutoloadLocalClasses
There were 2 CacheHelper keys in the array. Remove the one that pointed
to a non-existent file.

Change-Id: Ifb418fe8742b5515b500a6662b10efccd8273195
2014-10-21 21:46:38 -06:00
umherirrender
52f5634ba0 Migrate merge log to new log system
This allows use of gender on Special:Log
Old message is kept for use in irc,
a test is added to ensure a unchanged irc message.

Change-Id: I0557a0d2751540cf0d7967333ffd767b934011c6
2014-10-21 16:49:06 +00:00
jenkins-bot
cf93d76c03 Merge "Remove hitcounters and associated code" 2014-10-20 21:12:54 +00:00
Chad Horohoe
90d90dad6e Remove hitcounters and associated code
The hitcounter implementation in MediaWiki is flawed
and needs removal. For proper metrics, it is suggested to use
something like Piwik or Google Analytics.

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: I0e5006a7e8a09c800f8fa4effa9399e8afdd7a57
2014-10-20 13:01:55 -07:00
jenkins-bot
8aa43d083f Merge "Add a PSR-3 based logging interface" 2014-10-16 23:39:22 +00:00
Florianschmidtwelzow
317345b0df SpecialNewpages: Prepare for mw-ui
Use HTMLForm instead of self-built table structure, to be
prepared for use with MediaWiki UI.

Bug: 71446
Change-Id: I5c03dc543b910aab27a26a5a223341be50893cf3
2014-10-15 23:25:11 +02:00
Bryan Davis
9b35801650 Add a PSR-3 based logging interface
The MWLogger class is actually a thin wrapper around any PSR-3
LoggerInterface implementation. Named MWLogger instances can be obtained
from the MWLogger::getInstance() static method. MWLogger expects a class
implementing the MWLoggerSpi interface to act as a factory for new
MWLogger instances. A concrete MWLoggerSpi implementation using the
Monolog library is also provided.

New classes introduced:
; MWLogger
: PSR-3 compatible logger that wraps any \Psr\Log\LoggerInterface
  implementation
; MWLoggerSpi
: Service provider interface for MWLogger factories
; MWLoggerNullSpi
: MWLoggerSpi for creating instances that discard all log events
; MWLoggerMonologSpi
: MWLoggerSpi for creating instances backed by the monolog logging library
; MWLoggerMonologHandler
: Monolog handler that replicates the udp2log and file logging
  functionality of wfErrorLog()
; MWLoggerMonologProcessor
: Monolog log processer that adds host:wfHostname() and wiki:wfWikiID()
  to all records

New globals introduced:
; $wgMWLoggerDefaultSpi
: Default service provider interface to use with MWLogger
; $wgMWLoggerMonologSpiConfig
: Configuration for MWLoggerMonologSpi describing how to configure the
  Monolog logger instances.

This change relies on the Composer managed Psr\Log and Monolog libraries
introduced in Ie667944.

Change-Id: I5c822995a181a38c844f4a13cb172297827e0031
2014-10-14 00:20:32 +00:00
jenkins-bot
2e65d68c73 Merge "API: HTMLize and internationalize the help, add Special:ApiHelp" 2014-10-13 22:19:47 +00:00
Brad Jorsch
df457f3809 API: HTMLize and internationalize the help, add Special:ApiHelp
The existing API help, formatted as basically a plain-text document
embedded in XML and with a little bolding and a few links
syntax-highlighted in after the fact, works ok for experienced programmers
but isn't at all newbie-friendly. Further, all the help is hard-coded in
English, which isn't very friendly to non-English speakers.

So let's rewrite it. The help text is now obtained from i18n messages
and output in HTML, with the default display consisting of help for a
single module with links to help for other modules. This, of course,
necessitates deprecating many of the existing help-related methods and
hooks and replacing them with new ones, but backwards compatibility is
maintained for almost everything.

At the same time, action=paraminfo also needs to support the
'description' and other help-related fields being output in wikitext or
HTML, and I11cb063d (to access all modules via the 'modules' parameter
instead of having 'modules', 'formatmodules', 'querymodules', and so on)
is folded in.

And we also add Special:ApiHelp. When directly accessed, it simply
redirects to api.php with appropriate parameters. But it's also
transcludable to allow up-to-date API help text to be included within
the on-wiki documentation.

Note this patch doesn't actually add i18n messages for any API modules
besides ApiMain and ApiHelp. That will come in a followup patch, but for
the moment the backwards-compatibility code handles them nicely.

While we're messing with the documentation, we may as well add the
"internal" flag requested in bug 62905 (although the 'includeinternal'
parameter it also requests doesn't make much sense anymore) and a
"deprecated" flag that's needed by several modules now.

Bug: 30936
Bug: 38126
Bug: 42343
Bug: 45641
Bug: 62905
Bug: 63211
Change-Id: Ib14c00df06d85c2f6364d83b2b10ce34c7f513cc
2014-10-10 10:46:39 -04:00
aude
ec6ee905b5 Move TimestampException to exception directory
Change-Id: Id3829cbd155636839a272dc7e28e45bee7b87e8b
2014-10-06 11:03:54 +02:00
tholam
c24ef26d68 Set site logo in mediawiki.skinning.interface module instead of inline styles
Requires skins use the 'mw-wiki-logo' class on the logo element for the styles
to apply and to load the 'mediawiki.skinning.interface' module (or implement
their own skin module that uses the ResourceLoaderSkinModule class).

This is backwards compatible with skins using inline styles as the class only
applies when used.

Bug: 56257
Change-Id: I4e6db89a688843ac24539f8fd1b408c0d04881b3
2014-09-26 21:09:22 +00:00
jenkins-bot
e6e6861881 Merge "Add ability to pre-render thumbnails at upload time" 2014-09-25 15:40:07 +00:00
jenkins-bot
b022afc009 Merge "Split SkinTemplate.php per-class" 2014-09-24 15:59:08 +00:00
jenkins-bot
596e959d23 Merge "Add API output skin" 2014-09-24 15:20:41 +00:00
Brad Jorsch
55071b5bd9 Add API output skin
The API output for help and 'fm' formats will soon have need of
including ResourceLoader modules on an otherwise-bare page. The easiest
way to do this is to use OutputPage, but that requires a skin. So let's
add a skin that outputs a basic page without any navigation elements or
other chrome (that may be added later, but that can wait for Design to
decide they want to design it).

Change-Id: Ifa95fae5acaa3cfbf2ca58a15f8d0c51d84b455a
2014-09-24 11:07:57 -04:00
Bartosz Dziewoński
a3bf1f610e Split SkinTemplate.php per-class
Change-Id: Id964cdc3bd362d696628d62cd34615aa1fa6b014
2014-09-24 11:54:26 +02:00
Bartosz Dziewoński
bf1168b8cd Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions
Custom LESS functions are problematic for us for a number of reasons,
as outlined by Timo on bug 67368. We should get rid of them.

The only use case was implementing CSSMin data: URI embedding in LESS,
which used to be impossible due to lessc not preserving comments (bug
54673). However, thanks to new syntax added in f3779e06 we can insert
the annotations in such a way that the compiler won't mess with them.
The same technique is used in OOjs UI since 584ed144.

The LESS-function-based embedding implementation also meant that we
were unable to flip images for RTL (bug 66091 and friends: bug 66773,
bug 68326). The annotation one doesn't have this limitation.

Bug: 67368
Bug: 66091
Bug: 66773
Bug: 68326
Change-Id: I3062346ed63272a1c22b5df27b4cc1de2a699d9a
2014-09-20 20:28:22 +00:00
jenkins-bot
30646afb36 Merge "Add Special:MediaStatistics page for file type stats" 2014-09-19 08:03:42 +00:00
Brad Jorsch
8e938814c4 API: Add prop modules for backlinks
With the success of prop=redirects, let's create prop=linkshere,
prop=transcludedin, and prop=fileusage.

Let's also add a miser-mode-sensitive 'namespace' parameter to
prop=redirects, since the other three have a 'namespace' parameter using
the new *_from_namespace fields.

Change-Id: Ib650db9988a553771582eed0c183d0cae4b71252
2014-09-18 17:04:42 -04:00
Brian Wolff
e632eba946 Add Special:MediaStatistics page for file type stats
There used to be a bot on commons that did this, but it broke, and
this seems like the sort of thing that should be built in to
MediaWiki anyhow.

In order to do this, it abuses the querycache table somewhat
(Storing non-titles things in the title column).

Also changes the link on Special:Statistics for number of
uploads to link to new page. It seemed appropriate to link
to more detailed statistics instead of to Special:ListFiles.

Change-Id: I9ab768584b02a32b450d5f3981ff775ee07fecfa
2014-09-18 14:28:57 -03:00
jenkins-bot
c4ed6d1898 Merge "Add MultiConfig for fallback logic" 2014-09-18 13:13:39 +00:00
Kunal Mehta
412c4668f1 Add MultiConfig for fallback logic
This change adds MultiConfig and HashConfig classes,
but does not actually use them anywhere. In a future
change, we can convert DefaultSettings.php into
a HashConfig instance and use MultiConfig as the
'main' config instance.

Bug: 69418
Change-Id: I0ef2fbb86d5c27602d70240219ee08be31e2d09b
2014-09-17 15:55:04 -07:00
jenkins-bot
53e8f804e7 Merge "Start moving page move logic out of Title" 2014-09-16 22:51:37 +00:00
jenkins-bot
96efe0bc66 Merge "Revamp classic edit toolbar not to hardcode paths in HTML" 2014-09-16 12:51:21 +00:00
jenkins-bot
ed7ae208a4 Merge "Split BitmapHandler into two classes." 2014-09-16 08:27:49 +00:00
Yuri Astrakhan
3a28ee5acb CSS/JSON/JavaScript ContentHandler refactoring
* All content handlers that deal with code/data tend to have
English as their page language & pageview language, so moved common
code to the abstract CodeContentHandler class.

* Renamed JSONContent & JSONContentHandler into JsonContent*

Change-Id: I46819a0572ef5becc211d0d82471ff7102edaa3c
2014-09-15 08:24:15 +00:00
Kunal Mehta
77698193f9 Start moving page move logic out of Title
This moves most of the Title::moveTo() function into a new MovePage
class, and the entirety of the Title::moveToInternal() function.

No actual code was changed except for requiring a User object in
function arguments instead of relying up on $wgUser, and changes
to "$this" as necessary.

Change-Id: I5479fa8f3920a51ddf789d55edae7dd0d9b24382
2014-09-14 19:29:53 -07:00
Brian Wolff
757a70ae0a Split BitmapHandler into two classes.
BitmapHandler has a lot of generic-ish functionality that could
be re-usable by extension classes (Such as how it organizes
$scalerParams array, or various image magick escaping methods).
However it's combined with a lot of very format specific things,
such as the shell-out call to image magick.

Try to separate out the more generic stuff into
TransformationalImageHandler. In order to do this, I also made
canRotate, autoRotateEnabled, and getScalerType non-static. No
extensions in our repo appeared to be using these methods, and they
don't really make sense to be static (imo).

In particular, I think code duplication can be reduced in
PagedTiffHandler by extending this new class. See comments
on I1b9a77a4a56eeb65.

Change-Id: Id3a8b25a598942572cb5791a95e86054d7784961
2014-09-14 22:10:37 +00:00