[git] web/qa.git branch master updated. 3328545

From: Date: Wed, 15 Feb 2012 02:15:53 +0000
Subject: [git] web/qa.git branch master updated. 3328545
Groups: php.qa 
Request: Send a blank email to php-qa+get-66102@lists.php.net to get a copy of this message
The branch, master on web/qa.git has been updated via 33285455ee8881b2d1aab3683123fd1073aa5475 (commit) from b7a0f80cb1cc1c7fc239a78266b0165f08b5645e (commit) http://git.php.net/?p=web/qa.git;a=log;h=33285455ee8881b2d1aab3683123fd1073aa5475;hp=b7a0f80cb1cc1c7fc239a78266b0165f08b5645e Summary of changes: reports/reportsfunctions.php | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) -- Log ---------------------------------------- commit 33285455ee8881b2d1aab3683123fd1073aa5475 Author: Johannes Schlüter <johannes@php.net> Date: Wed Feb 15 03:05:36 2012 +0100 Filter out alpha and beta, too. diff --git a/reports/reportsfunctions.php b/reports/reportsfunctions.php index 67837d1..0a50b42 100644 --- a/reports/reportsfunctions.php +++ b/reports/reportsfunctions.php @@ -56,11 +56,19 @@ abstract class WhitelistedFilterIterator extends FilterIterator } } -class RCFilterIterator extends WhitelistedFilterIterator +class keywordFilterIterator extends WhitelistedFilterIterator { + private $keyword; + + public function __construct(Traversable $inner, $keyword, array $whitelist) + { + parent::__construct($inner, $whitelist); + $this->keyword = preg_quote($keyword, ','); + } + public function accept() { - return $this->inWhitelist() || !preg_match(',RC[0-9]+$,', $this->key()); + return $this->inWhitelist() || !preg_match(','.$this->keyword.'[0-9]+$,', $this->key()); } } @@ -72,11 +80,13 @@ class devFilterIterator extends WhitelistedFilterIterator } } -const QA_REPORT_FILTER_NONE = 0; -const QA_REPORT_FILTER_RC = 1; -const QA_REPORT_FILTER_DEV = 2; +const QA_REPORT_FILTER_NONE = 0; +const QA_REPORT_FILTER_ALPHA = 1; +const QA_REPORT_FILTER_BETA = 2; +const QA_REPORT_FILTER_RC = 4; +const QA_REPORT_FILTER_DEV = 8; -const QA_REPORT_FILTER_ALL = 3; +const QA_REPORT_FILTER_ALL = 15; /** * Analyse sqlite files and retrieve data from it @@ -89,8 +99,14 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL) $data = array(); $it = new QaReportIterator(new DirectoryIterator(__DIR__.'/db/')); + if ($mode & QA_REPORT_FILTER_ALPHA) { + $it = new keywordFilterIterator($it, 'alpha', $QA_RELEASES['reported']); + } + if ($mode & QA_REPORT_FILTER_BETA) { + $it = new keywordFilterIterator($it, 'beta', $QA_RELEASES['reported']); + } if ($mode & QA_REPORT_FILTER_RC) { - $it = new RCFilterIterator($it, $QA_RELEASES['reported']); + $it = new keywordFilterIterator($it, 'RC', $QA_RELEASES['reported']); } if ($mode & QA_REPORT_FILTER_DEV) { $it = new devFilterIterator($it, $QA_RELEASES['reported']); Thank you for your contribution.

« previous php.qa (#66102) next »