Commit graph

10 commits

Author SHA1 Message Date
diesel kapasule
8a31497c5f Remove unused configuration global $wgLegacySchemaConversion
I removed $wgLegacySchemaConversion from config-vars and
HistoryBlobCurStub.

Bug: T303684
Change-Id: I7f918ab61ffea377bd827721f9b41ae5d8f82226
2022-05-30 20:59:05 +02:00
Umherirrender
975d7e9e4a historyblob: Improve param and property documentation
Also cast scalar types when needed

Change-Id: I88b17fe03d398df1ce2686aa0e223fc58e97e037
2022-03-08 23:45:44 +00:00
Tim Starling
20d06b34bb Safer autoloading with respect to file-scope code
Many files were in the autoloader despite having potentially harmful
file-scope code.

* Exclude all CommandLineInc maintenance scripts from the autoloader.
* Introduce  "NO_AUTOLOAD" tag which excludes the file containing it
  from the autoloader. Use it on CommandLineInc.php and a few
  suspicious-looking files without classes in case they are refactored
  to add classes in the future.
* Add a test which parses all non-PSR4 class files and confirms that
  they do not contain dangerous file-scope code. It's slow (15s) but
  its results were enlightening.
* Several maintenance scripts define constants in the file scope,
  intending to modify the behaviour of MediaWiki. Either move the
  define() to a later setup function, or protect with NO_AUTOLOAD.
* Use require_once consistently with Maintenance.php and
  doMaintenance.php, per the original convention which is supposed to
  allow one maintenance script to use the class of another maintenance
  script. Using require breaks autoloading of these maintenance class
  files.
* When Maintenance.php is included, check if MediaWiki has already
  started, and if so, return early. Revert the fix for T250003 which
  is incompatible with this safety measure. Hopefully it was superseded
  by splitting out the class file.
* In runScript.php add a redundant PHP_SAPI check since it does some
  things in file-scope code before any other check will be run.
* Change the if(false) class_alias(...) to something more hackish and
  more compatible with the new test.
* Some site-related scripts found Maintenance.php in a non-standard way.
  Use the standard way.
* fileOpPerfTest.php called error_reporting(). Probably debugging code
  left in; removed.
* Moved mediawiki.compress.7z registration from the class file to the
  caller.

Change-Id: I1b1be90343a5ab678df6f1b1bdd03319dcf6537f
2021-01-11 11:59:36 +11:00
Umherirrender
bc5cb7ae64 phan: Enable redundant_condition_detection
Remove duplicate casts
Suppress false positives

Bug: T248438
Change-Id: I2f89664a4bcd3b39b15e7cf850adda2f0c90ae6f
2020-07-01 20:13:07 +00:00
Umherirrender
fd1ed0c092 Pass function name to database functions
Useful for logging

Change-Id: Ia2160fb6be5fc93f28ab51f7ae23d7f078247481
2020-06-07 14:16:52 +02:00
Reedy
b3734a0ef4 Fix even more Squiz.Scope.MethodScope.Missing
Change-Id: I0c3f8ce7fddfa6886413cdaf1edc236c4dfff44e
2020-05-17 03:07:58 +01:00
Umherirrender
0688dd7c6d Set method visibility for various constructors
Change-Id: Id3c88257e866923b06e878ccdeddded7f08f2c98
2019-12-03 20:17:30 +01:00
Umherirrender
f74400487f phan: Disable enable_class_alias_support
It is enabled for b/c in extensions, but not needed in core

Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
2019-09-15 08:26:52 +00:00
James D. Forrester
9bd93469a7 build: Updating mediawiki/mediawiki-phan-config to 0.6.1
Change-Id: I370fed5248c8b243527cafb77d80ddb6f4bc7064
2019-07-10 10:17:03 -07:00
Umherirrender
7ede3c619a Move HistoryBlob classes to own files
Move all into own subfolder

Change-Id: Iccf1bb9a2c8927c1b4dc0952d59d745109a71f76
2019-03-25 20:29:47 +01:00