1 | <?php |
||
8 | abstract class Resolver |
||
9 | { |
||
10 | |||
11 | /** @var string context page ID */ |
||
12 | protected $contextID; |
||
13 | /** @var string namespace of context page ID */ |
||
14 | protected $contextNS; |
||
15 | |||
16 | /** |
||
17 | * @param string $contextID the current pageID that's the context to resolve relative IDs to |
||
18 | */ |
||
19 | public function __construct($contextID) |
||
24 | |||
25 | /** |
||
26 | * Resolves a given ID to be absolute |
||
27 | * |
||
28 | * @param string $id The ID to resolve |
||
29 | * @param string|int|false $rev The revision time to use when resolving |
||
30 | * @param bool $isDateAt Is the given revision only a datetime hint not an exact revision? |
||
31 | * @return string |
||
32 | */ |
||
33 | public function resolveId($id, $rev = '', $isDateAt = false) |
||
47 | |||
48 | /** |
||
49 | * Handle IDs starting with . or ~ and prepend the proper prefix |
||
50 | * |
||
51 | * @param string $id |
||
52 | * @return string |
||
53 | */ |
||
54 | protected function resolvePrefix($id) |
||
71 | |||
72 | /** |
||
73 | * Handle . and .. within IDs |
||
74 | * |
||
75 | * @param string $id |
||
76 | * @return string |
||
77 | */ |
||
78 | protected function resolveRelatives($id) |
||
100 | |||
101 | } |
||
102 |