From 39cebc44e40cc2fa71d28029e440056ee24d04a5 Mon Sep 17 00:00:00 2001 From: inhere Date: Thu, 1 Feb 2018 14:10:26 +0800 Subject: [PATCH] update readme --- README.md | 19 ++++--------------- README_en.md | 6 +++--- docs/router.md | 6 +++--- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4c1ef67..8123f6d 100644 --- a/README.md +++ b/README.md @@ -119,11 +119,7 @@ Macaw - first route (1000 routes) | 999 | 2.710132 | +2.703545 | 41047% slower ## 使用 -- `Inhere\Route\SRouter` 是静态类版本 -- `Inhere\Route\ORouter` 是对象版本 -- `Inhere\Route\CachedRouter` 是支持缓存的版本 - -两个类的方法名和参数都是一样的 +> 各个版本的方法名和参数都是一样的 首先, 导入类 @@ -198,7 +194,7 @@ $router->rest('/users', App\Controllers\UserController::class); $router->any('*', 'fallback_handler'); ``` -> 如果配置了 `'ignoreLastSep' => true`, '/index' 等同于 '/index/' +> 如果配置了 `'ignoreLastSlash' => true`, '/index' 等同于 '/index/' #### 注意 @@ -309,7 +305,7 @@ Now, 访问 `/im/john/18` 或者 `/im/john` 查看效果 ```php // set config $router->setConfig([ - 'ignoreLastSep' => true, + 'ignoreLastSlash' => true, 'autoRoute' => 1, 'controllerNamespace' => 'app\\controllers', 'controllerSuffix' => 'Controller', @@ -514,14 +510,7 @@ MIT 功能丰富的命令行应用,命令行工具库 -### `inhere/redis` [github](https://github.com/inhere/php-redis) [git@osc](https://git.oschina.net/inhere/php-redis) - -简单的redis操作客户端包装库 - ### `inhere/php-validate` [github](https://github.com/inhere/php-validate) [git@osc](https://git.oschina.net/inhere/php-validate) 一个简洁小巧且功能完善的php验证库。仅有几个文件,无依赖。 - -### `inhere/http` [github](https://github.com/inhere/php-http) [git@osc](https://git.oschina.net/inhere/php-http) - -http 工具库(`request` 请求 `response` 响应 `curl` curl请求库,有简洁、完整和并发请求三个版本的类) + \ No newline at end of file diff --git a/README_en.md b/README_en.md index f1e5e3d..dddbe50 100644 --- a/README_en.md +++ b/README_en.md @@ -135,7 +135,7 @@ $router->group('/user', function () { ### use controller action ```php -// if you config 'ignoreLastSep' => true, '/index' is equals to '/index/' +// if you config 'ignoreLastSlash' => true, '/index' is equals to '/index/' $router->get('/index', 'app\controllers\Home@index'); ``` @@ -209,7 +209,7 @@ Will directly execute the callback ```php // set config $router->setConfig([ - 'ignoreLastSep' => true, + 'ignoreLastSlash' => true, // 'matchAll' => '/', // a route path // 'matchAll' => function () { @@ -230,7 +230,7 @@ $router->setConfig([ // there are default config. [ // ignore last '/' char. If is True, will clear last '/', so '/home' equals to '/home/' - 'ignoreLastSep' => false, + 'ignoreLastSlash' => false, // matchAll all request. // 1. If is a valid URI path, will matchAll all request uri to the path. diff --git a/docs/router.md b/docs/router.md index d2adfab..c95aa2e 100644 --- a/docs/router.md +++ b/docs/router.md @@ -66,7 +66,7 @@ $router->group('/user', function ($router) { }); ``` -> 如果配置了 `'ignoreLastSep' => true`, '/index' 等同于 '/index/' +> 如果配置了 `'ignoreLastSlash' => true`, '/index' 等同于 '/index/' ### 实现原理(如何收集) @@ -334,7 +334,7 @@ todo ... ```php // set config $router->setConfig([ - 'ignoreLastSep' => true, + 'ignoreLastSlash' => true, 'autoRoute' => 1, 'controllerNamespace' => 'app\\controllers', 'controllerSuffix' => 'Controller', @@ -347,7 +347,7 @@ $router->setConfig([ // 所有的默认的配置 // 是否忽略最后的 '/' 分隔符. 如果是 true,将清除最后一个 '/', 此时请求 '/home' 和 '/home/' 效果相同 - 'ignoreLastSep' = false, + 'ignoreLastSlash' = false, // 匹配所有请求 // 1. 如果是一个有效的URI路径,将匹配所有请求到此URI路径。