microphork-package package-auth
An authentication package for the microphork framework
microphork/package-auth
An authentication package for the microphork framework
- Sunday, March 23, 2014
- by elenor
- Repository
- 1 Watchers
- 0 Stars
- 261 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Introduction
This is an authentication package for the microphork framework. The authentication class is a dispatcher. Currently the only available handler spoofs the user data., (*1)
To extend this package create a \Phork\App\Auth class in the app/classes folder and an app/config/auth.php file to define the active handler., (*2)
Usage
//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 />')
;
Credits
Built by Elenor at Phork Labs., (*3)
License
Licensed under The MIT License
http://www.opensource.org/licenses/mit-license.php, (*4)
dev-master
9999999-dev
An authentication package for the microphork framework
Sources
Download
The Requires