Commit graph

18 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
daniel
26b51aac83 Update maintenance/README
The old README hadn't been updated in 15 years and was obsolete.
The new version reflects the introduction of MaintenanceRunner in
1.40.

Change-Id: I49c77eb2b34603e3241b57b3642c44903f84c09a
2023-03-03 10:10:59 -05:00
Timo Tijhof
ade945b97a Remove obsolete showCacheStats.php and showCacheStats.php
These scripts interact with keys that used to be set by ParserCache.php.
However this hasn't been the case for a long time now. They use wfIncrStats(),
which is configured by $wgStatsdServer.

Change-Id: Id6a62aec57801085ed684af9362a96eca0914e92
2015-12-07 19:49:29 +00:00
Kevin Israel
ca839bd033 maintenance/README: Remove importTextFile.php
Follows-up 14303bfea4.

Also corrected the capitalization of findHooks.php.

Change-Id: I6de35e368b8b091592b150a17cbce92b49c5ecf2
2014-07-21 17:10:23 -04:00
Waldir Pimenta
158bf7cb55 normalize filenames of maintenance scripts
Use lowerCamelCase.php format for all files (per [[mw:CC#File_naming]]),
and make filenames more specific:
- clear_stats.php -> clearCacheStats.php
- clear_interwiki_cache.php -> clearInterwikiCache.php
- initStats.php -> initSiteStats.php
- proxy_check.php -> proxyCheck.php
- stats.php -> showCacheStats.php
- showStats.php -> showSiteStats.php

Also changed the class names accordingly (per [[mw:CC/PHP#Naming]]),
and make class names more specific:
- clear_stats -> ClearCacheStats
- InitStats -> InitSiteStats
- CacheStats -> ShowCacheStats
- ShowStats -> ShowSiteStats

Updated files that made references to the changed files/classes:
- DefaultSettings.php and SpecialBlockme.php (proxy_check.php -> proxyCheck.php)
- maintenance/showSiteStats.php (initStats.php -> initSiteStats.php)
- maintenance/README and docs/memcached.txt (stats.php -> showCacheStats.php)
- docs/maintenance.txt and docs/memcached.txt (clear_stats.php -> clearCacheStats.php)

Thanks Hashar for the initial help and encouragement :)

Change-Id: I60f76fc971e06e1b710dcda35f9c2d931b93bdd7
2013-03-06 03:57:54 +00:00
umherirrender
c157f4d424 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I52ae3c55044bc8c53698e356bad74969406670bf
2012-10-20 13:32:35 +02:00
Chad Horohoe
d0ff1e57ff * (bug 14201) Set $wgDBadminuser/$wgDBadminpassword during setup
* (bug 18768) Remove AdminSettings requirements. Maintenance environment will still load it if it exists, but it's not required for anything
2009-07-23 00:31:37 +00:00
Brion Vibber
1c9773bd01 Revert r52336 "Merge maintenance-work branch:"
Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks!
2009-06-24 02:49:24 +00:00
Chad Horohoe
59b60fc311 Merge maintenance-work branch:
* (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php
* (bug 18768) Remove AdminSettings.php from MediaWiki core
* (bug 19157) createAndPromote error on bad password
* (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php
* Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs.
* Not deleting "unused" files yet, don't want to break everything at once :)
2009-06-24 02:02:37 +00:00
Chad Horohoe
eecfbfb0bb (bug 18122) Fix fatal require() errors and typo in the README. 2009-03-24 15:03:36 +00:00
Alexandre Emsenhuber
fb38bbf72f docs update 2008-03-13 19:00:19 +00:00
Rob Church
fbe821cd1b * Add option to maintenance/createAndPromote.php to give the user bureaucrat permissions (--bureaucrat)
* Some --help on maintenance/createAndPromote.php
* Tweak maintenance/README
2007-07-06 23:24:10 +00:00
Brion Vibber
6466660b2c Add newline at end of file. (Done mainly to test the new svn server, but it's nice eh?) 2007-05-31 21:54:35 +00:00
Rob Church
e4f57c202c Maintenance script to import multiple files into the wiki 2006-05-15 10:57:52 +00:00
Rob Church
eff2fa3b36 Maintenance script to import the contents of a text file into a wiki page 2006-04-14 17:24:43 +00:00
Rob Church
2a9326a3ac Extend documentation on maintenance scripts 2006-03-28 02:38:48 +00:00
Ævar Arnfjörð Bjarmason
c837afb526 archives not archive 2005-04-06 16:55:55 +00:00
Lee Daniel Crocker
d82c14fb4f Initial revision 2003-04-14 23:10:40 +00:00