Rest server base class.
More...
Rest server base class.
Ubiquity\controllers\rest$RestServer 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.8
Definition at line 21 of file RestServer.php.
◆ __construct()
__construct |
( |
& |
$config, |
|
|
|
$headers = null |
|
) |
| |
◆ _addHeaderToken()
_addHeaderToken |
( |
|
$token | ) |
|
◆ _getHeader()
◆ _getHeaderToken()
◆ _header()
_header |
( |
|
$headerField, |
|
|
|
$value = null , |
|
|
bool |
$replace = true |
|
) |
| |
- Parameters
-
string | $headerField | |
string | $value | |
boolean | $replace | |
Definition at line 188 of file RestServer.php.
◆ _loadApiTokens()
◆ _setContentType()
_setContentType |
( |
|
$contentType = null , |
|
|
|
$charset = null |
|
) |
| |
- Parameters
-
string | $contentType | default application/json |
string | $charset | default utf8 |
Definition at line 204 of file RestServer.php.
◆ addAllowedOrigin()
addAllowedOrigin |
( |
|
$address | ) |
|
Adds an allowed origin for access control.
- Parameters
-
Definition at line 264 of file RestServer.php.
◆ addOtherHeaders()
◆ connect()
Establishes the connection with the server, returns an added token in the Authorization header of the request.
- Returns
- array
Definition at line 62 of file RestServer.php.
◆ cors()
◆ finalizeTokens()
◆ getAllowedOrigin()
◆ getApiTokens()
◆ getRestNamespace()
static getRestNamespace |
( |
| ) |
|
|
static |
◆ isValid()
Check if token is valid.
- Parameters
-
- Returns
- boolean
- Exceptions
-
Definition at line 86 of file RestServer.php.
◆ newApiTokens()
To override for defining another ApiToken type.
- Returns
- ApiTokens
Definition at line 155 of file RestServer.php.
◆ refreshToken()
Refresh an active token.
- Returns
- array
- Exceptions
-
Definition at line 73 of file RestServer.php.
◆ setAccessControlAllowOriginHeader()
setAccessControlAllowOriginHeader |
( |
| ) |
|
|
protected |
◆ setAllowedOrigin()
setAllowedOrigin |
( |
|
$address = '*' | ) |
|
Adds an unique allowed origin for access control.
- Parameters
-
Definition at line 242 of file RestServer.php.
◆ setAllowedOrigins()
setAllowedOrigins |
( |
|
$addresses | ) |
|
Sets the allowed origins for access control.
- Parameters
-
Definition at line 255 of file RestServer.php.
◆ setTokenDuration()
setTokenDuration |
( |
|
$tokenDuration | ) |
|
◆ setTokenLength()
setTokenLength |
( |
|
$tokenLength | ) |
|
◆ tokenCallback()
tokenCallback |
( |
|
$callback | ) |
|
|
private |
◆ $allowedOrigins
◆ $apiTokens
◆ $config
◆ $headers
◆ $tokenDuration
◆ $tokenLength
◆ $tokensCacheKey
$tokensCacheKey = '_apiTokens' |
|
protected |
◆ $tokensFolder
The documentation for this class was generated from the following file:
- C:/Users/myadd/Documents/GitHub/ubiquity-doc-api/vendor/phpmv/ubiquity/src/Ubiquity/controllers/rest/RestServer.php