You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
649 B
PHP
29 lines
649 B
PHP
<?php
|
|
|
|
namespace BusinessLogic;
|
|
|
|
|
|
class Helpers {
|
|
static function getHeader($key) {
|
|
$headers = getallheaders();
|
|
|
|
$uppercaseHeaders = array();
|
|
foreach ($headers as $header => $value) {
|
|
$uppercaseHeaders[strtoupper($header)] = $value;
|
|
}
|
|
|
|
return isset($uppercaseHeaders[$key])
|
|
? $uppercaseHeaders[$key]
|
|
: NULL;
|
|
}
|
|
|
|
static function hashToken($token) {
|
|
return hash('sha512', $token);
|
|
}
|
|
|
|
static function safeArrayGet($array, $key) {
|
|
return $array !== null && array_key_exists($key, $array)
|
|
? $array[$key]
|
|
: null;
|
|
}
|
|
} |