PHP 클래스 Imbo\EventListener\AccessToken

This event listener will listen to all GET and HEAD requests and make sure that they include a valid access token. The official PHP-based imbo client (https://github.com/imbo/imboclient-php) appends this token to all such requests by default. If the access token is missing or invalid the event listener will throw an exception resulting in a HTTP response with 400 Bad Request.
저자: Christer Edvartsen ([email protected])
상속: implements Imbo\EventListener\ListenerInterface
파일 보기 프로젝트 열기: imbo/imbo 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $params = null ) Class constructor
checkAccessToken ( Imbo\EventManager\EventInterface $event )
getSubscribedEvents ( )

보호된 메소드들

메소드 설명
getAlternativeURL ( string $url, integer $encoding = PHP_QUERY_RFC3986 ) : string Helper method to generate an alternative form of an URL, where array indices have either been added or removed. foo[] is transformed into foo[0], while foo[0] is transformed into foo[].
getEscapedAlternativeURL ( $url ) : string Generate an escaped, alternative version of an url.
getUnescapedAlternativeURL ( $url ) : string Generate an unescaped, alternative version of an url.

비공개 메소드들

메소드 설명
isWhitelisted ( Request $request ) : boolean Check if the request is whitelisted

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( array $params = null )
$params array Parameters for the listener

checkAccessToken() 공개 메소드

public checkAccessToken ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface

getAlternativeURL() 보호된 메소드

The result for URLs with both formats is undefined, or for URLs that intermingle their parameters, i.e. t[]=foo&b[]=bar&t[]=baz This was introduced because of differences between the URLs generated by the different clients, and because Facebook (at least) generates URLs were []s in URL arguments are expanded to [0] when requested from the backend. Since we sign our URLs, this breaks the token generation and thus breaks URLs when Facebook attempts to retrieve them.
protected getAlternativeURL ( string $url, integer $encoding = PHP_QUERY_RFC3986 ) : string
$url string The URL to generate the alternative form of
$encoding integer The encoding to use - from GuzzleHttp\Psr7
리턴 string

getEscapedAlternativeURL() 보호된 메소드

Generate an escaped, alternative version of an url.
또한 보기: AccessToken::getAlternativeURL()
protected getEscapedAlternativeURL ( $url ) : string
$url string The URL to generate the alternative version of
리턴 string

getSubscribedEvents() 공개 정적인 메소드

public static getSubscribedEvents ( )

getUnescapedAlternativeURL() 보호된 메소드

Generate an unescaped, alternative version of an url.
또한 보기: AccessToken::getAlternativeURL()
protected getUnescapedAlternativeURL ( $url ) : string
$url string The URL to generate the alternative version of
리턴 string