Méthode |
Description |
|
__callStatic ( string $name, arrya $args ) : mixed |
Handle undefined static function calls |
|
authenticate ( array $credentials, boolean $remember = false ) : boolean |
Authenticate a user given the username/password credentials |
|
buildDataSource ( array $config, array $result ) : DataSource |
Build a datasource object |
|
buildModel ( string $action = 'find', string $name, array $args ) : object |
Build the model instance with data given |
|
checkRememberMe ( ) : boolean | Psecio\Gatekeeper\UserModel |
Check the "Remember Me" token information (if it exists) |
|
clearRestrictions ( ) |
Clear out the current restrictions |
|
createPolicy ( array $policy ) : boolean |
Allow for the creation of a policy as a callback too |
|
disableThrottle ( ) |
Disable the throttling |
|
enableThrottle ( ) |
Enable the throttling feature |
|
evaluatePolicy ( string $name, mixed $data ) : boolean |
Evaluate the policy (found by name) against the data provided |
|
getConfig ( string $index = null ) : mixed |
Get the current configuration information
If an index is given, it tries to find it. If found,
returns just that value. If not, returns null. Otherwise
returns all config values |
|
getDatasource ( ) : DataSource |
Get the current datasource |
|
getLastError ( ) : string |
Get the last error message from the current datasource |
|
getLogger ( ) : Psr\Log\LoggerInterface |
Get the current logger instance |
|
getRestrictions ( ) : array |
Get the current list of restrictions |
|
getUserThrottle ( integer $userId ) : Psecio\Gatekeeper\ThrottleModel |
Get the user throttle information
If not found, makes a new one |
|
hash_equals ( string $hash1, string $hash2 ) : boolean |
Safer way to evaluate if hashes equal |
|
init ( string $envPath = null, array $config = [], DataSource $datasource = null, $logger = null ) |
Initialize the Gatekeeper instance, set up environment file and PDO connection |
|
loadConfig ( array $config, string $envPath = null ) : array |
Get the configuration either from the config given or .env path |
|
modelFactory ( string $type, array $data = [] ) : object |
Create and setup a new model instance |
|
register ( array $userData ) : boolean |
Register a new user |
|
rememberMe ( Psecio\Gatekeeper\UserModel | string $user, array $config = [] ) : boolean |
Enable and set up the "Remember Me" cookie token handling for the given user |
|
restrict ( string $type, array $config ) |
Create a restriction and add it to be evaluated |
|
setConfig ( array $config ) |
Set the current configuration options |
|
setDatasource ( DataSource $ds ) |
Set the current data source to the one given |
|
setLogger ( Psr\Log\LoggerInterface $logger = null ) |
Set the current logger interface
If the logger value is null, a Monolog instance will be created |
|
throttleStatus ( ) : boolean |
Return the enabled/disabled status of the throttling |
|