Class: myRouter

网站路由处理
$router = new myRouter();
$router->format('hex', '[a-fA-F0-9]+');
$router->rule('/test/[any]/[str]/[hex]/[yyy]/[int]', function() {var_dump(func_get_args());});
$router->check('/test/哈哈/string/aB123f/yyy/123456');
$router->parseQuery()
1 init
     * 参数初始化
     * @param array $setting
     * @param string $p
     * @param string $q
     
2 parseQuery
     * 解析路径及查询字串
     * @param $qstr
     * @return array
     
3 format
     * 设置路由辨别格式
     * @param $name
     * @param $pattern
     * @return $this
     
4 setFormats
     * 批量设置路由辨别格式
     * @param $formats
     * @return $this
     
5 rule
     * 设置路由规则
     * @param $rule
     * @param $method
     * @return $this
     
6 setRules
     * 批量设置路由规则
     * @param $rules
     * @param string $idx
     * @return $this
     
7 check
     * 路由规则检测
     * @return bool
     
8 parse
     * APP路由信息解析
     
9 remove
     * 移除某条规则
     * @param $file
     * @param $idx
     * @return bool
     
10 checkRoute
     * 检查并添加路由
     * @param $path_main
     * @param $path_this
     * @param $idx
     * @return bool
     
11 __construct
     * 通用构造方法,转移到 init 方法
     
12 setErrHandler
     * 设置错误处理函数
     * @param $func
     
13 error
     * 通用错误处理方法
     * @param $msg
     * @param bool $exit
     * @return bool