Mark V
1: <?php
2: namespace MOC\V\Core\AutoLoader\Component\Bridge\Repository;
3:
4: use MOC\V\Core\AutoLoader\Component\Bridge\Bridge;
5: use MOC\V\Core\AutoLoader\Component\IBridgeInterface;
6: use MOC\V\Core\AutoLoader\Component\Parameter\Repository\DirectoryParameter;
7: use MOC\V\Core\AutoLoader\Component\Parameter\Repository\NamespaceParameter;
8: use MOC\V\Core\AutoLoader\Vendor\Universal\NamespaceLoader;
9:
10: /**
11: * Class UniversalNamespace
12: *
13: * @package MOC\V\Core\AutoLoader\Component\Bridge
14: */
15: class UniversalNamespace extends Bridge implements IBridgeInterface
16: {
17:
18: /** @var NamespaceLoader $Instance */
19: private $Instance = null;
20:
21: /**
22: *
23: */
24: public function __construct()
25: {
26:
27: $this->Instance = new NamespaceLoader();
28: }
29:
30: /**
31: * @param string $ClassName
32: *
33: * @return bool
34: */
35: public function loadSourceFile($ClassName)
36: {
37:
38: return $this->Instance->loadClass($ClassName);
39: }
40:
41: /**
42: * @param NamespaceParameter $Namespace
43: * @param DirectoryParameter $Directory
44: *
45: * @return IBridgeInterface
46: */
47: public function addNamespaceDirectoryMapping(NamespaceParameter $Namespace, DirectoryParameter $Directory)
48: {
49:
50: $this->Instance->addNamespaceMapping($Namespace->getNamespace(), $Directory->getDirectory());
51: return $this;
52: }
53:
54: /**
55: * @return string
56: */
57: public function getLoaderHash()
58: {
59:
60: return $this->Instance->getLoaderHash();
61: }
62: }
63: