Custom Auth_Container -- Build a custom storage container
Custom Storage Containers
Here is a skeleton for a custom Auth storage container
Example 28-1. CustomAuthContainer.php include_once 'Auth/Container.php';
class CustomAuthContainer extends Auth_Container
{
/**
* Constructor
*/
function CustomAuthContainer($params)
{
// Init Here
}
function fetchData($username, $password)
{
// Check If valid etc
if($isvalid) {
// Perform Some Actions
return true;
}
return false;
}
} |
|
And here is how to use it.
Example 28-2. authcustom.php include_once 'CustomAuthContainer.php';
include_once 'Auth/Auth.php';
$auth_container = new CustomAuthContainer($params);
$myauth = new Auth($auth_container);
$myauth->start(); |
|