Exemplo n.º 1
0
 /**
  * 设置api类所在的路径
  * @param string $path
  * @throws ApiException
  * @return AppApi
  */
 public function setApiPath($path)
 {
     $path = rtrim($path, '\\/') . DIRECTORY_SEPARATOR;
     if (file_exists($path)) {
         self::$_apiPath = $path;
         set_include_path(get_include_path() . PATH_SEPARATOR . self::$_apiPath);
     } else {
         throw new ApiException("{$path}目录不存在", ApiError::API_PATH_NO_EXIST);
     }
     return $this;
 }