config = $config; $this->driver = $this->getDriverClass($type); } /** * 获取启用的存储引擎 */ public function getDriverClass(string $type){ $class = __NAMESPACE__ . '\\driver\\' . ucfirst(strtolower($type)); return new $class($this->config); } /** * 动态调用 * @param $method * @param $arguments * @return mixed */ public function __call($method, $arguments) { return $this->driver->{$method}(...$arguments); } }