PHP 클래스 Locker\Helpers\Helpers

파일 보기 프로젝트 열기: learninglocker/learninglocker 1 사용 예제들

공개 메소드들

메소드 설명
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).