X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fbenchmarks%2Fbench_utf8_title_check.php;h=3091de6208da06089ed7199cef3b6fbbd49df25b;hb=ed9a5fcb243218ea24908dddb9c28cb334788d10;hp=c92a7208680683c2c95cc8e8e5a620bc988dfa31;hpb=0af7afc9d3f7e82078c5d372473689e2ed7e7d27;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/benchmarks/bench_utf8_title_check.php b/maintenance/benchmarks/bench_utf8_title_check.php index c92a720868..3091de6208 100644 --- a/maintenance/benchmarks/bench_utf8_title_check.php +++ b/maintenance/benchmarks/bench_utf8_title_check.php @@ -32,6 +32,8 @@ require_once __DIR__ . '/Benchmarker.php'; class BenchUtf8TitleCheck extends Benchmarker { private $data; + private $isutf8; + public function __construct() { parent::__construct(); @@ -41,7 +43,7 @@ class BenchUtf8TitleCheck extends Benchmarker { "United States of America", // 7bit ASCII "S%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e", "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn", - // This comes from bug 36839 + // This comes from T38839 "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn%7C" . "Catherine%20Willows%7CDavid%20Hodges%7CDavid%20Phillips%7CGil%20Grissom%7CGreg%20Sanders%7CHodges%7C" . "Internet%20Movie%20Database%7CJim%20Brass%7CLady%20Heather%7C" @@ -84,29 +86,26 @@ class BenchUtf8TitleCheck extends Benchmarker { ]; } $this->bench( $benchmarks ); - print $this->getFormattedResults(); } - private $isutf8; - - function use_regexp( $s ) { + protected function use_regexp( $s ) { $this->isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); } - function use_regexp_non_capturing( $s ) { + protected function use_regexp_non_capturing( $s ) { // Same as above with a non-capturing subgroup. $this->isutf8 = preg_match( '/^(?:[\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); } - function use_regexp_once_only( $s ) { + protected function use_regexp_once_only( $s ) { // Same as above with a once-only subgroup. $this->isutf8 = preg_match( '/^(?>[\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ); } - function use_mb_check_encoding( $s ) { + protected function use_mb_check_encoding( $s ) { $this->isutf8 = mb_check_encoding( $s, 'UTF-8' ); } }