From: Reedy Date: Sun, 14 Apr 2019 21:10:40 +0000 (+0100) Subject: Rename PhpBugTests -> PhpXMLBugTester X-Git-Tag: 1.34.0-rc.0~1981 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=79502d48e636a31c05ef5f52753a634767cbc4cb Rename PhpBugTests -> PhpXMLBugTester Only contains one class (probably should be removed when we bump to PHP 7 fully) Change-Id: Iab2bb837e2ed5d5556bd49f4236030b43aba29f1 --- diff --git a/.phpcs.xml b/.phpcs.xml index b4503a631d..aa79ce63d6 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -70,7 +70,6 @@ Whitelist existing violations, but enable the sniff to prevent any new occurrences. --> - */includes/installer/PhpBugTests\.php */includes/specials/SpecialMostinterwikis\.php */includes/diff/DairikiDiff\.php */includes/specials/SpecialAncientpages\.php diff --git a/autoload.php b/autoload.php index fe5e7cfa33..2ec234ab51 100644 --- a/autoload.php +++ b/autoload.php @@ -1103,7 +1103,7 @@ $wgAutoloadLocalClasses = [ 'PerRowAugmentor' => __DIR__ . '/includes/search/PerRowAugmentor.php', 'PermissionsError' => __DIR__ . '/includes/exception/PermissionsError.php', 'PhpHttpRequest' => __DIR__ . '/includes/http/PhpHttpRequest.php', - 'PhpXmlBugTester' => __DIR__ . '/includes/installer/PhpBugTests.php', + 'PhpXmlBugTester' => __DIR__ . '/includes/installer/PhpXmlBugTester.php', 'Pingback' => __DIR__ . '/includes/Pingback.php', 'PoolCounter' => __DIR__ . '/includes/poolcounter/PoolCounter.php', 'PoolCounterNull' => __DIR__ . '/includes/poolcounter/PoolCounterNull.php', diff --git a/includes/installer/PhpBugTests.php b/includes/installer/PhpBugTests.php deleted file mode 100644 index 4e1e365dbf..0000000000 --- a/includes/installer/PhpBugTests.php +++ /dev/null @@ -1,49 +0,0 @@ -c'; - $xml = '' . htmlspecialchars( $charData ) . ''; - - $parser = xml_parser_create(); - xml_set_character_data_handler( $parser, [ $this, 'chardata' ] ); - $parsedOk = xml_parse( $parser, $xml, true ); - $this->ok = $parsedOk && ( $this->parsedData == $charData ); - } - - public function chardata( $parser, $data ) { - $this->parsedData .= $data; - } -} diff --git a/includes/installer/PhpXmlBugTester.php b/includes/installer/PhpXmlBugTester.php new file mode 100644 index 0000000000..4e1e365dbf --- /dev/null +++ b/includes/installer/PhpXmlBugTester.php @@ -0,0 +1,49 @@ +c'; + $xml = '' . htmlspecialchars( $charData ) . ''; + + $parser = xml_parser_create(); + xml_set_character_data_handler( $parser, [ $this, 'chardata' ] ); + $parsedOk = xml_parse( $parser, $xml, true ); + $this->ok = $parsedOk && ( $this->parsedData == $charData ); + } + + public function chardata( $parser, $data ) { + $this->parsedData .= $data; + } +}