1 | <?php |
||
14 | class Resource |
||
15 | { |
||
16 | private $original; |
||
17 | private $target; |
||
18 | |||
19 | /** |
||
20 | * Constructor |
||
21 | * |
||
22 | * @param string $original |
||
23 | * @param string $target |
||
24 | */ |
||
25 | public function __construct($original, $target) |
||
30 | |||
31 | /** |
||
32 | * Returns the target |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getTarget() |
||
40 | |||
41 | /** |
||
42 | * Returns the original path |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getOriginal() |
||
50 | |||
51 | /** |
||
52 | * Returns whether the resource can be processed in place given a context or not. |
||
53 | * |
||
54 | * For example : |
||
55 | * - /path/to/file1 can be processed to file1 in /path/to context |
||
56 | * - /path/to/subdir/file2 can be processed to subdir/file2 in /path/to context |
||
57 | * |
||
58 | * @param string $context |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function canBeProcessedInPlace($context) |
||
76 | |||
77 | /** |
||
78 | * Returns a context for computing this resource in case it is possible. |
||
79 | * |
||
80 | * Useful to avoid teleporting. |
||
81 | * |
||
82 | * @return null|string |
||
83 | */ |
||
84 | public function getContextForProcessInSinglePlace() |
||
100 | |||
101 | /** |
||
102 | * Returns true if the resource is local. |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | private function isLocal() |
||
116 | } |
||
117 |