Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
SvnRevTagTablePager | |
0.00% |
0 / 16 |
|
0.00% |
0 / 4 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getDefaultSort | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getQueryInfo | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
6 | |||
getTitle | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\CodeReview\UI; |
4 | |
5 | use SpecialPage; |
6 | |
7 | class SvnRevTagTablePager extends SvnRevTablePager { |
8 | public function __construct( $view, $tag ) { |
9 | parent::__construct( $view ); |
10 | $this->mTag = $tag; |
11 | } |
12 | |
13 | public function getDefaultSort() { |
14 | return 'ct_rev_id'; |
15 | } |
16 | |
17 | public function getQueryInfo() { |
18 | $info = parent::getQueryInfo(); |
19 | |
20 | if ( $this->mView->mPath ) { |
21 | array_unshift( $info['tables'], 'code_paths' ); |
22 | $info['conds'][] = 'cr_repo_id=cp_repo_id'; |
23 | $info['conds'][] = 'cr_id=cp_rev_id'; |
24 | $info['conds']['cp_path'] = $this->mView->mPath; |
25 | } |
26 | // Don't change table order, see https://www.mediawiki.org/wiki/Special:Code/MediaWiki/77733 |
27 | // Bug in mysql 4 allowed incorrect table ordering joins to work |
28 | array_unshift( $info['tables'], 'code_tags' ); |
29 | $info['conds'][] = 'cr_repo_id=ct_repo_id'; |
30 | $info['conds'][] = 'cr_id=ct_rev_id'; |
31 | // fixme: normalize input? |
32 | $info['conds']['ct_tag'] = $this->mTag; |
33 | return $info; |
34 | } |
35 | |
36 | public function getTitle() { |
37 | $repo = $this->mRepo->getName(); |
38 | return SpecialPage::getTitleFor( 'Code', "$repo/tag/$this->mTag" ); |
39 | } |
40 | } |