PHP Класс voku\helper\Bootup

this is a bootstrap for the polyfills (iconv / intl / mbstring / normalizer / xml)
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
filterRequestInputs ( integer $normalization_form = 4, string $leading_combining = '◌' ) filter request inputs
filterRequestUri ( string | null $uri = null, boolean $exit = true ) : mixed Filter current REQUEST_URI .
filterString ( string $s, integer $normalization_form = 4, string $leading_combining = '◌' ) : string Normalizes to UTF-8 NFC, converting from WINDOWS-1252 when needed.
get_random_bytes ( integer $length ) : string | false Get random bytes via "random_bytes()" (+ polyfill).
initAll ( ) bootstrap
is_php ( string $version ) : boolean Determines if the current version of PHP is equal to or greater than the supplied value.

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

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

Ensures inputs are well formed UTF-8 When not, assumes Windows-1252 and converts to UTF-8 Tests only values, not keys
public static filterRequestInputs ( integer $normalization_form = 4, string $leading_combining = '◌' )
$normalization_form integer
$leading_combining string

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

Filter current REQUEST_URI .
public static filterRequestUri ( string | null $uri = null, boolean $exit = true ) : mixed
$uri string | null

If null is set, then the server REQUEST_URI will be used.

$exit boolean
Результат mixed

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

Normalizes to UTF-8 NFC, converting from WINDOWS-1252 when needed.
public static filterString ( string $s, integer $normalization_form = 4, string $leading_combining = '◌' ) : string
$s string
$normalization_form integer
$leading_combining string
Результат string

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

Get random bytes via "random_bytes()" (+ polyfill).
public static get_random_bytes ( integer $length ) : string | false
$length integer Output length
Результат string | false false on error

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

bootstrap
public static initAll ( )

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

Determines if the current version of PHP is equal to or greater than the supplied value.
public static is_php ( string $version ) : boolean
$version string
Результат boolean

Return true if the current version is $version or higher