Setup: Move MWDebug logic to MWDebug.php
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 31 Aug 2019 22:43:23 +0000 (23:43 +0100)
committerKrinkle <krinklemail@gmail.com>
Wed, 4 Sep 2019 16:33:25 +0000 (16:33 +0000)
commitd18e76dbef35efeb1f735bb070e54be5dc629e4b
treeeb5a89019ea25f893735430c2f315422396cb5c1
parentb0c56c7050227d5422d3b539b9ddcc44b7bf9e5a
Setup: Move MWDebug logic to MWDebug.php

* Remove checks in HTMLFileCache.php and Article.php.

  These haven't been needed since the same check was added to Setup.php,
  many years ago. When FileCache is enabled, The Setup.php code disables
  MWDebug. There is no reason for FileCache to then also disable itself
  based on unused config. That means both of them lose.
  We now handle this logic in one place: MWDebug::setup().

* In rebuildFileCache.php, turn it off explicitly, just in case.
  The previous code there didn't work because finalSetup()
  is called after doMaintenance.php includes Setup.php, which
  is what checked this config var to decide on MWDebug::init.
  On the other hand, it's also always off in CLI mode.
  But, let's not depend on that, maybe we decide to enable it on
  CLI one day! Just keep it off explicitly here.

Bug: T189966
Change-Id: I45a8f77092249751dc6f276aa5bb67ebf5b4f64c
includes/Setup.php
includes/cache/HTMLFileCache.php
includes/debug/MWDebug.php
includes/page/Article.php
maintenance/rebuildFileCache.php