Setup: Deprecate StartProfiler, move default to DefaultSettings
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 19 Mar 2018 01:21:02 +0000 (18:21 -0700)
committerKrinkle <krinklemail@gmail.com>
Thu, 29 Mar 2018 21:29:03 +0000 (21:29 +0000)
commit5209adff6cf13a002843347d5e3942aeb5c255ce
tree45015056b047d3443ad8b63a53bbc81024382314
parentaf7635ad4843aac1c047003836cadc3f7933d540
Setup: Deprecate StartProfiler, move default to DefaultSettings

$wgProfiler was introduced in 3ea576aa25 (r15605; 2006; MW 1.8).
The global was used from the Profiler.php class file, which
would be manually from StartProfiler.php, which then (if enabled)
assigned the global an actual instance of the Profiler class.

We needed it that way because we actually instantiated and used
the Profiler object (via wfProfileIn) very early on in WebStart.
Specifically, before any settings and classes load.

This first changed in 5a6d1ee2d3 (r86228; 2011; MW 1.17).
That commit deprecated use of $wgProfiler as an object in favour
of assigning it an array that MediaWiki would use to construct
the class. Profiling methods were also changed to lazy-instantiate
the class, which would first happen via a wfProfileIn() call two
lines before loading DefaultSettings and LocalSettings.

Some more relevant clean up happened in a0123d0549 (r89206; 2011).

Now, in 2018, we don't actually lazy-instantiate the Profiler
until after DefaultSetting and LocalSettings load. As such, I
think we can finally get rid of its out-of-bound load strategy.

Instead, we can simply set the default in DefaultSettings, and
recommend admins to set their value in LocalSettings.

Bug: T189966
Change-Id: I4e8dd9558132a5e38c22b26fed9c4b54cd324da7
StartProfiler.sample [deleted file]
includes/DefaultSettings.php
includes/Setup.php
tests/phpunit/autoload.ide.php