PHP Class Psr7Middlewares\Utils\Helpers

Afficher le fichier Open project: oscarotero/psr7-middlewares Class Usage Examples

Méthodes publiques

Méthode Description
fixPath ( string $path ) : string helper function to fix paths '//' or '/./' or '/foo/.
getMimeType ( Psr\Http\Message\ResponseInterface $response ) : string Return the mime type.
getOutput ( integer $level ) : string Return the output buffer.
hashEquals ( string $a, string $b ) : boolean Very short timing attack safe string comparison for PHP < 5.6 http://php.net/manual/en/function.hash-equals.php#118384.
isAjax ( Psr\Http\Message\RequestInterface $request ) : boolean Check whether a request is or not ajax.
isPost ( Psr\Http\Message\RequestInterface $request ) : boolean Check if a request is post or any similar method.
isRedirect ( Psr\Http\Message\ResponseInterface $response ) : boolean Check whether a response is a redirection.
joinPath ( ) : string Join several pieces into a path.

Method Details

fixPath() public static méthode

./' in a path.
public static fixPath ( string $path ) : string
$path string Path to resolve
Résultat string

getMimeType() public static méthode

Return the mime type.
public static getMimeType ( Psr\Http\Message\ResponseInterface $response ) : string
$response Psr\Http\Message\ResponseInterface
Résultat string

getOutput() public static méthode

Return the output buffer.
public static getOutput ( integer $level ) : string
$level integer
Résultat string

hashEquals() public static méthode

Very short timing attack safe string comparison for PHP < 5.6 http://php.net/manual/en/function.hash-equals.php#118384.
public static hashEquals ( string $a, string $b ) : boolean
$a string
$b string
Résultat boolean

isAjax() public static méthode

Check whether a request is or not ajax.
public static isAjax ( Psr\Http\Message\RequestInterface $request ) : boolean
$request Psr\Http\Message\RequestInterface
Résultat boolean

isPost() public static méthode

Check if a request is post or any similar method.
public static isPost ( Psr\Http\Message\RequestInterface $request ) : boolean
$request Psr\Http\Message\RequestInterface
Résultat boolean

isRedirect() public static méthode

Check whether a response is a redirection.
public static isRedirect ( Psr\Http\Message\ResponseInterface $response ) : boolean
$response Psr\Http\Message\ResponseInterface
Résultat boolean

joinPath() public static méthode

Join several pieces into a path.
public static joinPath ( ) : string
Résultat string