PHP Класс Locker\Helpers\Helpers

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
checkForNull ( $array ) * |--------------------------------------------------------------------------- | Loop through a statement and check for NULL values.
convertIds ( $models = [] )
getAgentIdentifier ( stdClass $actor ) : String | null Determines which identifier is currently in use in the given actor.
getClient ( String $username, $password ) : Model Checks the authentication.
getCurrentDate ( ) : String Gets the current date and time in ISO format using the current timezone.
getEnvVar ( $var )
getEnvironment ( AssocArray $config, String $givenHost ) : String Gets the environment by matching a given host to a config.
getGravatar ( $email, $size = '50' ) * |--------------------------------------------------------------------------- | Get gravatar |---------------------------------------------------------------------------
getLrsFromAuth ( ) : Locker\Helpers\Lrs Gets the current LRS from the Authorization header.
getLrsFromUserPass ( String $username, String $password ) : Locker\Helpers\Lrs Gets the Lrs associated with the given username and password.
getUserPassFromAuth ( ) : [String] Gets the username and password from the authorization string.
getUserPassFromBAuth ( String $authorization ) : [String] Gets the Client/Lrs username and password from the Basic Auth authorization string.
getUserPassFromOAuth ( String $authorization ) : [String] Gets the Client/Lrs username and password from the OAuth authorization string.
mixedMultipartContentType ( $boundary = null )
replaceFullStop ( $array ) * |--------------------------------------------------------------------------- | Loop through a statement and check keys for full stops, if exist, replace.
replaceFullStopInKeys ( $string ) * |--------------------------------------------------------------------------- | Mongo doesn't allow full stops in keys, so replace with html entity &46; |---------------------------------------------------------------------------
replaceHtmlEntity ( $array, $toArray = false ) * |---------------------------------------------------------------------------- | scan array and replace &46; with . (This is a result of . being | reserved in Mongo) convert array to json as this is faster for | multi-dimensional arrays (?) @todo check this out.
validateAtom ( Locker\XApi\Atom $atom, String $trace = null ) Validates a XAPIAtom.

Описание методов

checkForNull() статический публичный метод

|---------------------------------------------------------------------------
static public checkForNull ( $array )

convertIds() публичный статический метод

public static convertIds ( $models = [] )

getAgentIdentifier() статический публичный метод

Determines which identifier is currently in use in the given actor.
static public getAgentIdentifier ( stdClass $actor ) : String | null
$actor stdClass
Результат String | null Identifier in use.

getClient() статический публичный метод

Checks the authentication.
static public getClient ( String $username, $password ) : Model
$username String
Результат Model

getCurrentDate() статический публичный метод

Gets the current date and time in ISO format using the current timezone.
static public getCurrentDate ( ) : String
Результат String Current ISO date and time.

getEnvVar() статический публичный метод

static public getEnvVar ( $var )

getEnvironment() статический публичный метод

Gets the environment by matching a given host to a config.
static public getEnvironment ( AssocArray $config, String $givenHost ) : String
$config AssocArray Configuration mapping an environment => hosts
$givenHost String A string representing the host.
Результат String Matched environment from the config.

getGravatar() статический публичный метод

* |--------------------------------------------------------------------------- | Get gravatar |---------------------------------------------------------------------------
static public getGravatar ( $email, $size = '50' )

getLrsFromAuth() статический публичный метод

Gets the current LRS from the Authorization header.
static public getLrsFromAuth ( ) : Locker\Helpers\Lrs
Результат Locker\Helpers\Lrs

getLrsFromUserPass() статический публичный метод

Gets the Lrs associated with the given username and password.
static public getLrsFromUserPass ( String $username, String $password ) : Locker\Helpers\Lrs
$username String
$password String
Результат Locker\Helpers\Lrs

getUserPassFromAuth() статический публичный метод

Gets the username and password from the authorization string.
static public getUserPassFromAuth ( ) : [String]
Результат [String]

getUserPassFromBAuth() статический публичный метод

Gets the Client/Lrs username and password from the Basic Auth authorization string.
static public getUserPassFromBAuth ( String $authorization ) : [String]
$authorization String
Результат [String]

getUserPassFromOAuth() статический публичный метод

Gets the Client/Lrs username and password from the OAuth authorization string.
static public getUserPassFromOAuth ( String $authorization ) : [String]
$authorization String
Результат [String]

mixedMultipartContentType() публичный статический метод

public static mixedMultipartContentType ( $boundary = null )

replaceFullStop() статический публичный метод

|---------------------------------------------------------------------------
static public replaceFullStop ( $array )

replaceFullStopInKeys() статический публичный метод

* |--------------------------------------------------------------------------- | Mongo doesn't allow full stops in keys, so replace with html entity &46; |---------------------------------------------------------------------------
static public replaceFullStopInKeys ( $string )

replaceHtmlEntity() статический публичный метод

|----------------------------------------------------------------------------
static public replaceHtmlEntity ( $array, $toArray = false )

validateAtom() статический публичный метод

Validates a XAPIAtom.
static public validateAtom ( Locker\XApi\Atom $atom, String $trace = null )
$atom Locker\XApi\Atom Atom to be validated.
$trace String Where the atom has came from (i.e. request parameter name).