| 1 | <?php |
||
| 9 | class Server |
||
| 10 | { |
||
| 11 | protected $wrapper; |
||
| 12 | |||
| 13 | protected $startingCallbacks = []; |
||
| 14 | |||
| 15 | 20 | public function __construct($wrapper, $wrapper_file = '') |
|
| 16 | { |
||
| 17 | 20 | if (!class_exists($wrapper)) { |
|
| 18 | require $wrapper_file; |
||
| 19 | } |
||
| 20 | 20 | $ref = new ReflectionClass($wrapper); |
|
| 21 | 20 | if(!$ref->implementsInterface(ServerInterface::class)) { |
|
| 22 | throw new Exception("$wrapper must be instance of Laravoole\\Wrapper\\ServerInterface", 1); |
||
| 23 | } |
||
| 24 | |||
| 25 | 20 | $this->wrapper = $wrapper; |
|
| 26 | 20 | } |
|
| 27 | |||
| 28 | public function getWrapper() |
||
| 32 | |||
| 33 | 20 | public function start($configs) |
|
| 40 | |||
| 41 | } |
||
| 42 |