Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ApiTokens Class Reference

Manage the token api for the Rest part. More...

Public Member Functions

 __construct ($length=10, $duration=3600, $tokens=[])
 
 getTokens ()
 
 getDuration ()
 
 getToken ($key)
 
 isExpired ($key)
 
 addToken ($datas=null)
 
 refreshToken (string $key)
 Refresh the token using an existing one.
 
 clearAll ()
 
 removeExpireds ()
 
 remove ($key)
 
 storeToCache ($key='_apiTokens')
 
 getFromCache ($folder, $key='_apiTokens')
 

Protected Member Functions

 generateToken ()
 
 tokenGenerator ()
 

Protected Attributes

 $tokens
 
 $length
 
 $duration
 

Static Protected Attributes

static $cache
 

Detailed Description

Manage the token api for the Rest part.

Ubiquity\controllers\rest$ApiTokens This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.2

Definition at line 16 of file ApiTokens.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $length = 10,
  $duration = 3600,
  $tokens = [ ] 
)

Definition at line 22 of file ApiTokens.php.

Member Function Documentation

◆ addToken()

addToken (   $datas = null)

Definition at line 59 of file ApiTokens.php.

◆ clearAll()

clearAll ( )

Definition at line 83 of file ApiTokens.php.

◆ generateToken()

generateToken ( )
protected

Definition at line 28 of file ApiTokens.php.

◆ getDuration()

getDuration ( )

Definition at line 43 of file ApiTokens.php.

◆ getFromCache()

getFromCache (   $folder,
  $key = '_apiTokens' 
)
Parameters
$folder
string$key
Returns
ApiTokens

Definition at line 115 of file ApiTokens.php.

◆ getToken()

getToken (   $key)

Definition at line 47 of file ApiTokens.php.

◆ getTokens()

getTokens ( )

Definition at line 39 of file ApiTokens.php.

◆ isExpired()

isExpired (   $key)

Definition at line 51 of file ApiTokens.php.

◆ refreshToken()

refreshToken ( string  $key)

Refresh the token using an existing one.

Parameters
string$key
Returns
false|string

Definition at line 74 of file ApiTokens.php.

◆ remove()

remove (   $key)

Definition at line 96 of file ApiTokens.php.

◆ removeExpireds()

removeExpireds ( )

Definition at line 87 of file ApiTokens.php.

◆ storeToCache()

storeToCache (   $key = '_apiTokens')

Definition at line 104 of file ApiTokens.php.

◆ tokenGenerator()

tokenGenerator ( )
protected

Definition at line 35 of file ApiTokens.php.

Field Documentation

◆ $cache

$cache
staticprotected

Definition at line 20 of file ApiTokens.php.

◆ $duration

$duration
protected

Definition at line 19 of file ApiTokens.php.

◆ $length

$length
protected

Definition at line 18 of file ApiTokens.php.

◆ $tokens

$tokens
protected

Definition at line 17 of file ApiTokens.php.


The documentation for this class was generated from the following file: