PHP code example of zjlsliupei / phpweb
1. Go to this page and download the library: Download zjlsliupei/phpweb library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zjlsliupei / phpweb example snippets
// 实例化token类,并采用tp的缓存方案来保存token
$ins = \token\Factory::instance(\token\driver\TpCache::class);
// token绑定参数为'{"name":"liupei"}', 过期时间为3600秒,并返回生成的token
$token = $ins->set('{"name":"liupei"}', 3600);
// 配置不检测token的pathinfo,不区分大小写
'allow_pathinfo' => [
'index/index/index', // index/index/index接口不验证token
]