Commit graph

6 commits

Author SHA1 Message Date
Timo Tijhof
5209adff6c 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
2018-03-29 21:29:03 +00:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
Timo Tijhof
25d3185dde Setup: Include StartProfiler before others
Bug: T180183
Change-Id: Ibcf78d094cf4dcf09bc919a5f8168f45ae225ebc
2017-11-09 16:35:19 -08:00
Timo Tijhof
fbfc69f5da Merge ProfilerFunctions into GlobalFunctions
Even if people use these (deprecated) functions in the earliest hooks or in
LocalSettings.php, it will keep working because GlobalFunctions is loaded
between DefaultSettings.php and LocalSettings.php.

The only places affected would be files in core: AutoLoader.php, Defines.php,
and DefaultSettings.php, which don't use these functions.

Change-Id: If4c0e8cbe1ea918283df22d72f792a3806569216
2017-11-09 16:31:55 -08:00
Bartosz Dziewoński
ecdef925bb Miscellaneous indentation tweaks
I was bored. What? Don't look at me that way.

I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.

Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
2017-02-27 19:23:54 +01:00
Aleksey Bekh-Ivanov (WMDE)
3ca13774e2 PHPUnit autoload file for PhpStorm
`autoload.ide.php` is PhpUnit entry point for PhpStorm IDE
and other JetBrains IDEs.
This file should be set in `Languages and frameworks > PHP > PhpUnit`
select `Use Composer autoloader` and set `Path to script` to `tests/phpunit/autoload.ide.php`

After that, tests can be run in PhpStorm using Right-click > Run
or `Ctrl + Shift + F10`. Also, tests can be run with debugger.

`autoload.ide.php` basically  does almost the same thing
as `tests/phpunit/phpunit.php`,
except that all code is executed inside some function, so some hacks
needed to make old code to be executed as if it was executed on top
of the execution stack.

PS: Mostly it is copy-paste from `phpunit.php` and `doMaintenance.php`.

Change-Id: Idcee38d149542f747ed52c8c9491c6651a0581d9
2017-01-31 18:57:51 +00:00