Commit graph

3 commits

Author SHA1 Message Date
Dreamy Jazz
e7393b3cc7 Exclude boilerplate maintenance code from code coverage reports
Why:
* Maintenance scripts in core have bolierplate code that is
  added before and after the class to allow directly running
  the maintenance script.
* Running the maintenance script directly has been deprecated
  since 1.40, so this boilerplate code is only to support a now
  deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
  not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
  coverage reports as it cannot be marked as covered and also
  is for deprecated code.

What:
* Wrap the boilerplate code (requiring Maintenance.php and then
  later defining the maintenance script class and running if the
  maintenance script was called directly) with @codeCoverageIgnore
  comments.
* Some files use a different boilerplate code, however, these
  should also be marked as ignored for coverage for the same
  reason that coverage is not properly reported for files.

Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
2024-08-27 13:22:29 +01:00
Timo Tijhof
06aa9e9691 Follows-up d78869207
* File systems may be case-sensitive.
* Use ::class syntax for class literals.

Change-Id: Ia126b0b3a8fa702bf046e9539878a90e09fe9da7
2018-08-02 15:46:12 +00:00
Gergő Tisza
d788692076 Add maintenance script for deleting local passwords
This is mainly for the benefit of authentication extensions which
all need similar functionality for removing local passwords on a
wiki where local authentication was used for a while but has been
disabled, but can be used directly to just indiscriminately remove
the passwords of all users.

To test the change without irreversibly locking out users, an
option is provided to make the password invalid in an
easy-to-reverse way.

The immediate use case is I974184899c33.

This patch also introduces the maintenance/includes directory
to hold PHP files which are not executable scripts themselves.
(Previously such files had a .inc extension, but that is so PHP4.)

Bug: T57420
Change-Id: If7207b80a2c8374e90182e0b09d8f76ee94264b0
2018-08-02 13:47:33 +00:00