1: <?php
2:
3: namespace PHPixie\Filesystem\Locators\Locator;
4:
5: class Mount implements \PHPixie\Filesystem\Locators\Locator
6: {
7: protected $locatorRegistry;
8: protected $configData;
9:
10: protected $locator;
11:
12: public function __construct($locatorRegistry, $configData)
13: {
14: $this->locatorRegistry = $locatorRegistry;
15: $this->configData = $configData;
16: }
17:
18: public function locate($path, $isDirectory = false)
19: {
20: return $this->locator()->locate($path, $isDirectory);
21: }
22:
23: protected function locator()
24: {
25: if($this->locator === null) {
26: $name = $this->configData->getRequired('name');
27: $this->locator = $this->locatorRegistry->get($name);
28: }
29:
30: return $this->locator;
31: }
32: }