microphork / package-auth
该软件包已被废弃,不再维护。未建议替代软件包。
此软件包最新版本(dev-master)没有可用的许可信息。
microphork框架的认证软件包
dev-master
2019-03-14 01:07 UTC
Requires
This package is not auto-updated.
Last update: 2021-12-06 00:42:38 UTC
README
这是一个microphork框架的认证软件包。认证类是一个调度器。目前唯一的可用处理程序模拟用户数据。
要扩展此软件包,在app/classes
文件夹中创建一个\Phork\App\Auth
类,并创建一个app/config/auth.php
文件来定义活动处理程序。
使用方法
//load and initialize a new auth package
$class = \Phork::instance()->initPackage('Auth');
$auth = new $class();
//get the loaded config
$config = \Phork::config()->get('auth');
//initialize the auth handler
if ($config->handlers && $handlers = $config->handlers->export()) {
$auth->init($handlers);
}
//show the user data
\Phork::output()
->addContent('authenticated: '.$auth->isAuthenticated().'<br />')
->addContent('user id: '.$auth->getUserId().'<br />')
->addContent('user name: '.$auth->getUserName().'<br />')
;
鸣谢
由Elenor在Phork Labs构建。
许可
根据MIT许可证授权 https://open-source.org.cn/licenses/mit-license.php