kaythinks / kayroute
这是一个可以与任何PHP包配合使用的PHP路由包
1.1.0
2020-12-31 20:55 UTC
Requires
- php: ^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: ^7|^8.0
README
-- 运行 composer require kaythinks/kayroute
-- 运行 composer dump-autoload
-- 创建一个 index.php 文件
-- 例如,您可以将以下代码放入 index.php 文件中,并使用内置的 PHP 服务器 (php -S localhost:8000) 来使用此库。
<?php
require_once 'vendor/autoload.php';
use Kaythinks\KayRoute\Router;
Router::get('/test',function(){
var_dump('I got here');
});
Router::get('/','HomeController@getHome');
-- 注意:您必须有一个类似这样的命名空间结构 App\Controllers\{The Controller File} 才能使用它配合控制器文件。此包支持自动装配。
要了解更多关于路由器方法的信息,请点击此链接 Wiki
Apache benchmarking HTTP request result for 100 concurrrent requests:- ab -n 100 -c 100 https://:7879/
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, https://apache.ac.cn/
Benchmarking localhost (be patient).....done
Server Software:
Server Hostname: localhost
Server Port: 7879
Document Path: /
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 0.031 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 16300 bytes
HTML transferred: 0 bytes
Requests per second: 3222.69 [#/sec] (mean)
Time per request: 31.030 [ms] (mean)
Time per request: 0.310 [ms] (mean, across all concurrent requests)
Transfer rate: 512.99 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 0.7 2 3
Processing: 1 14 8.4 16 27
Waiting: 0 14 8.4 16 27
Total: 4 16 7.7 18 27
Percentage of the requests served within a certain time (ms)
50% 18
66% 21
75% 23
80% 24
90% 26
95% 27
98% 27
99% 27
100% 27 (longest request)