From: Antoine Musso Date: Tue, 29 Nov 2011 12:17:55 +0000 (+0000) Subject: Move terminal colorers classes in their own file X-Git-Tag: 1.31.0-rc.0~26234 X-Git-Url: http://git.cyclocoop.org/%27.parametre_url%28%20%20%20generer_action_auteur%28%27charger_plugin%27%2C%20%27update_flux%27%29%2C%27update_flux%27%2C%20%27oui%27%29.%27?a=commitdiff_plain;h=269bce91d1462062551bb807a0783b8ce1887933;p=lhc%2Fweb%2Fwiklou.git Move terminal colorers classes in their own file They were originally written for parserTests output and were in tests/testHelpers.inc since them. Those classes can be used by most our maintenance scripts anyway, so here is their new home. Also make tests/testHelpers.inc a bit shorter which is always welcome. --- diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index a92f7db907..7a1f3685d6 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -885,11 +885,13 @@ $wgAutoloadLocalClasses = array( 'textStatsOutput' => 'maintenance/language/StatOutputs.php', 'wikiStatsOutput' => 'maintenance/language/StatOutputs.php', + # maintenance/term + 'AnsiTermColorer' => 'maintenance/term/MWTerm.php', + 'DummyTermColorer' => 'maintenance/term/MWTerm.php', + # tests - 'AnsiTermColorer' => 'tests/testHelpers.inc', 'DbTestPreviewer' => 'tests/testHelpers.inc', 'DbTestRecorder' => 'tests/testHelpers.inc', - 'DummyTermColorer' => 'tests/testHelpers.inc', 'TestFileIterator' => 'tests/testHelpers.inc', 'TestRecorder' => 'tests/testHelpers.inc', diff --git a/maintenance/term/MWTerm.php b/maintenance/term/MWTerm.php new file mode 100644 index 0000000000..36fb8eec09 --- /dev/null +++ b/maintenance/term/MWTerm.php @@ -0,0 +1,50 @@ +color( 0 ); + } +} + +/* A colour-less terminal */ +class DummyTermColorer { + public function color( $color ) { + return ''; + } + + public function reset() { + return ''; + } +} + diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc index 39919cc5c6..9287d535c0 100644 --- a/tests/testHelpers.inc +++ b/tests/testHelpers.inc @@ -1,53 +1,5 @@ color( 0 ); - } -} - -/* A colour-less terminal */ -class DummyTermColorer { - public function color( $color ) { - return ''; - } - - public function reset() { - return ''; - } -} - class TestRecorder { var $parent; var $term;