1 | <?php |
||
16 | class WorkingCopyResolver |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * Repository connector. |
||
21 | * |
||
22 | * @var Connector |
||
23 | */ |
||
24 | private $_repositoryConnector; |
||
25 | |||
26 | /** |
||
27 | * Working copy paths. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $_workingCopyPaths = array(); |
||
32 | |||
33 | /** |
||
34 | * Mapping between working copy paths and their urls. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | private $_workingCopyUrlMapping = array(); |
||
39 | |||
40 | /** |
||
41 | * Mapping between path to working copy specified by user to one, that is actually used. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | private $_resolvedPathMapping = array(); |
||
46 | |||
47 | /** |
||
48 | * Creates working copy resolver instance. |
||
49 | * |
||
50 | * @param Connector $repository_connector Repository connector. |
||
51 | */ |
||
52 | 7 | public function __construct(Connector $repository_connector) |
|
56 | |||
57 | /** |
||
58 | * Returns URL to the working copy. |
||
59 | * |
||
60 | * @param string $raw_path Raw path. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 2 | public function getWorkingCopyUrl($raw_path) |
|
74 | |||
75 | /** |
||
76 | * Return working copy path. |
||
77 | * |
||
78 | * @param string $raw_path Raw path. |
||
79 | * |
||
80 | * @return string |
||
81 | * @throws \LogicException When folder isn't a working copy. |
||
82 | */ |
||
83 | 6 | public function getWorkingCopyPath($raw_path) |
|
99 | |||
100 | /** |
||
101 | * Returns absolute path to working copy from given raw path. |
||
102 | * |
||
103 | * @param string $raw_path Raw path. |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | 6 | protected function resolvePath($raw_path) |
|
127 | |||
128 | } |
||
129 |