Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SubversionAdaptor
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 3
42
0.00% covered (danger)
0.00%
0 / 1
 newFromRepo
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
12
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 canConnect
n/a
0 / 0
n/a
0 / 0
0
 getFile
n/a
0 / 0
n/a
0 / 0
0
 getDiff
n/a
0 / 0
n/a
0 / 0
0
 getDirList
n/a
0 / 0
n/a
0 / 0
0
 getLog
n/a
0 / 0
n/a
0 / 0
0
 _rev
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\Extension\CodeReview\Backend;
4
5abstract class SubversionAdaptor {
6    /**
7     * @var string
8     */
9    protected $mRepoPath;
10
11    /**
12     * @param string $repo
13     * @return SubversionAdaptor
14     */
15    public static function newFromRepo( $repo ) {
16        global $wgSubversionProxy, $wgSubversionProxyTimeout;
17        if ( $wgSubversionProxy ) {
18            return new SubversionProxy( $repo, $wgSubversionProxy, $wgSubversionProxyTimeout );
19        } elseif ( function_exists( 'svn_log' ) ) {
20            return new SubversionPecl( $repo );
21        } else {
22            return new SubversionShell( $repo );
23        }
24    }
25
26    /**
27     * @param string $repoPath Path to SVN Repo
28     */
29    public function __construct( $repoPath ) {
30        $this->mRepoPath = $repoPath;
31    }
32
33    abstract public function canConnect();
34
35    abstract public function getFile( $path, $rev = null );
36
37    abstract public function getDiff( $path, $rev1, $rev2 );
38
39    abstract public function getDirList( $path, $rev = null );
40
41    abstract public function getLog( $path, $startRev = null, $endRev = null );
42
43    protected function _rev( $rev, $default ) {
44        if ( $rev === null ) {
45            return $default;
46        } else {
47            return intval( $rev );
48        }
49    }
50}