From 269bce91d1462062551bb807a0783b8ce1887933 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 29 Nov 2011 12:17:55 +0000 Subject: [PATCH] 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. --- includes/AutoLoader.php | 6 +++-- maintenance/term/MWTerm.php | 50 +++++++++++++++++++++++++++++++++++++ tests/testHelpers.inc | 48 ----------------------------------- 3 files changed, 54 insertions(+), 50 deletions(-) create mode 100644 maintenance/term/MWTerm.php 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; -- 2.20.1