name = $name; $this->config_file = $config_file; $this->initialize($config); } /** * 设置错误信息 * @param string|null $error * @return bool */ protected function setError(?string $error = null) { $this->error = $error; return false; } /** * 获取错误信息 * @return string */ public function getError() { $error = $this->error; $this->error = null; return $error; } /** * 初始化 * @param array $config * @return mixed */ abstract protected function initialize(array $config); }