Mark V
1: <?php
2: namespace MOC\V\Core\SecureKernel;
3:
4: use MOC\V\Core\SecureKernel\Component\Bridge\Repository\SFTP;
5: use MOC\V\Core\SecureKernel\Component\IBridgeInterface;
6: use MOC\V\Core\SecureKernel\Component\IVendorInterface;
7: use MOC\V\Core\SecureKernel\Vendor\Vendor;
8:
9: /**
10: * Class SecureKernel
11: *
12: * @package MOC\V\Core\SecureKernel
13: */
14: class SecureKernel implements IVendorInterface
15: {
16:
17: /** @var IVendorInterface $VendorInterface */
18: private $VendorInterface = null;
19:
20: /**
21: * @param IVendorInterface $VendorInterface
22: */
23: public function __construct(IVendorInterface $VendorInterface)
24: {
25:
26: $this->setVendorInterface($VendorInterface);
27: }
28:
29: /**
30: * @return IBridgeInterface
31: */
32: public static function getSFTP()
33: {
34:
35: return self::getPhpSecLibSFTP();
36: }
37:
38: /**
39: * @return IBridgeInterface
40: */
41: private static function getPhpSecLibSFTP()
42: {
43:
44: $SFTP = new SecureKernel(
45: new Vendor(
46: new SFTP()
47: )
48: );
49:
50: return $SFTP->getBridgeInterface();
51: }
52:
53: /**
54: * @return IBridgeInterface
55: */
56: public function getBridgeInterface()
57: {
58:
59: return $this->VendorInterface->getBridgeInterface();
60: }
61:
62: /**
63: * @return IVendorInterface
64: */
65: public function getVendorInterface()
66: {
67:
68: return $this->VendorInterface;
69: }
70:
71: /**
72: * @param IVendorInterface $VendorInterface
73: *
74: * @return IVendorInterface
75: */
76: public function setVendorInterface(IVendorInterface $VendorInterface)
77: {
78:
79: $this->VendorInterface = $VendorInterface;
80: return $this;
81: }
82:
83: /**
84: * @param IBridgeInterface $BridgeInterface
85: *
86: * @return IBridgeInterface
87: */
88: public function setBridgeInterface(IBridgeInterface $BridgeInterface)
89: {
90:
91: return $this->VendorInterface->setBridgeInterface($BridgeInterface);
92: }
93: }
94: