phprs\util\ClassLoader::addInclude PHP Method

addInclude() public static method

public static addInclude ( unknown $path )
$path unknown
    public static function addInclude($path)
    {
        if (is_array($path)) {
            self::$includes = array_unique(array_merge(self::$includes, $path));
        } else {
            self::$includes[] = $path;
            self::$includes = array_unique(self::$includes);
        }
    }

Usage Example

Example #1
0
 /**
  * 
  */
 function __construct()
 {
     //AutoClassLoader确保序列化后自动加载类文件
     $this->class_loader = new AutoClassLoader();
     ClassLoader::addInclude($this->api_path);
     //TODO: 支持名字空间
     //TODO: 支持多路径多类名
     $this->load($this->api_path, $this->apis, $this->api_method);
     //允许通过接口访问api信息
     if ($this->export_apis) {
         $this->loadApi($this->routes, __DIR__ . '/apis/ApiExporter.php', 'phprs\\apis\\ApiExporter');
     }
 }
All Usage Examples Of phprs\util\ClassLoader::addInclude