123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace Mall\Framework\Core;
- class Swoole
- {
- static protected $instance;
- static public function getInstance($options = [], $driver = 'Client')
- {
- $driver = $driver ?: 'Client';
- if (!is_array($options) && !$options) {
- throw new \Exception('Need default Swoole ' . $driver . ' config');
- }
-
- $class = 'Mall\\Framework\\Swoole\\' . ucwords($driver);
- return new $class($options);
- }
- }
|