Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static static | getAllLanguages () |
static | charsArray (bool $replace_extra_symbols=false) |
static | clean (string $str, bool $normalize_whitespace=true, bool $keep_non_breaking_space=false, bool $normalize_msword=true, bool $remove_invisible_characters=true) |
static | is_ascii (string $str) |
static | remove_invisible_characters (string $str, bool $url_encoded=false, string $replacement='', bool $keep_basic_control_characters=true) |
static | to_filename (string $str, bool $use_transliterate=true, string $fallback_char='-') |
static | to_slugify (string $str, string $separator='-', string $language=self::ENGLISH_LANGUAGE_CODE, array $replacements=[], bool $replace_extra_symbols=false, bool $use_str_to_lower=true, bool $use_transliterate=false) |
Fonctions membres privées statiques | |
static | get_language (string $language) |
static | getData (string $file) |
static | getDataIfExists (string $file) |
static | prepareAsciiAndExtrasMaps () |
static | prepareAsciiMaps () |
static | prepareAsciiExtras () |
Attributs privés statiques | |
static | $ASCII_MAPS |
static | $ASCII_MAPS_AND_EXTRAS |
static | $ASCII_EXTRAS |
static | $ORD |
static | $LANGUAGE_MAX_KEY |
static | $REGEX_ASCII = "[^\x09\x10\x13\x0A\x0D\x20-\x7E]" |
static | $BIDI_UNI_CODE_CONTROLS_TABLE |
-immutable
|
static |
Returns an replacement array for ASCII methods.
EXAMPLE: $array = ASCII::charsArray(); var_dump($array['ru']['б']); // 'b'
-suppress InvalidNullableReturnType - we use the prepare* methods here, so we don't get NULL here
bool | $replace_extra_symbols | [optional] |
Add some more replacements e.g. "£" with " pound ".
-pure
-return array<string, array<string , string>>
|
static |
Accepts a string and removes all non-UTF-8 characters from it + extras if needed.
string | $str |
The string to be sanitized.
bool | $normalize_whitespace | [optional] |
Set to true, if you need to normalize the whitespace.
bool | $normalize_msword | [optional] |
Set to true, if you need to normalize MS Word chars e.g.: "…" => "..."
bool | $keep_non_breaking_space | [optional] |
Set to true, to keep non-breaking-spaces, in combination with $normalize_whitespace
bool | $remove_invisible_characters | [optional] |
Set to false, if you not want to remove invisible characters e.g.: "\0"
-pure
A clean UTF-8 string.
|
staticprivate |
Get the language from a string.
e.g.: de_at -> de_at de_DE -> de DE_DE -> de de-de -> de
ReturnTypeCanBeDeclaredInspection
string | $language | -pure |
Références $language.
|
static |
Get all languages from the constants "ASCII::.*LANGUAGE_CODE".
-return array<string, string>
Références $lang.
|
staticprivate |
Get data from "/data/*.php".
ReturnTypeCanBeDeclaredInspection
string | $file | -pure |
PhpIncludeInspection
UsingInclusionReturnValueInspection
-suppress UnresolvableInclude
Références __DIR__.
|
staticprivate |
Get data from "/data/*.php".
string | $file | -pure |
-suppress ImpureFunctionCall
PhpIncludeInspection
UsingInclusionReturnValueInspection
-suppress UnresolvableInclude
Références __DIR__.
|
static |
Checks if a string is 7 bit ASCII.
EXAMPLE: ASCII::is_ascii('白'); // false
string | $str |
The string to check.
-pure
true if it is ASCII
false otherwise
|
staticprivate |
-pure
-suppress PossiblyNullArgument - we use the prepare* methods here, so we don't get NULL here
Références null.
|
staticprivate |
|
staticprivate |
|
static |
Remove invisible characters from a string.
e.g.: This prevents sandwiching null characters between ascii characters, like Java\0script.
copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Common.php
string | $str | |
bool | $url_encoded | |
string | $replacement | |
bool | $keep_basic_control_characters | -pure |
Références $count.
|
static |
Convert given string to safe filename (and keep string case).
EXAMPLE: ASCII::to_filename('שדגשדג.png', true)); // 'shdgshdg.png'
string | $str | |
bool | $use_transliterate |
ASCII::to_transliterate() is used by default - unsafe characters are simply replaced with hyphen otherwise.
string | $fallback_char | -pure |
A string that contains only safe characters for a filename.
|
static |
Converts the string into an URL slug. This includes replacing non-ASCII characters with their closest ASCII equivalents, removing remaining non-ASCII and non-alphanumeric characters, and replacing whitespace with $separator. The separator defaults to a single dash, and the string is also converted to lowercase. The language of the source string can also be supplied for language-specific transliteration.
string | $str | |
string | $separator | [optional] |
The string used to replace whitespace.
string | $language | [optional] |
Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE
array<string,string> | $replacements [optional] |
A map of replaceable strings.
bool | $replace_extra_symbols | [optional] |
Add some more replacements e.g. "£" with " pound ".
bool | $use_str_to_lower | [optional] |
Use "string to lower" for the input.
bool | $use_transliterate | [optional] |
Use ASCII::to_transliterate() for unknown chars.
-pure
A string that has been converted to an URL slug.
Références $language, et $separator.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
const AMHARIC_LANGUAGE_CODE = 'am' |
const ARABIC_LANGUAGE_CODE = 'ar' |
const ARMENIAN_LANGUAGE_CODE = 'hy' |
const AZERBAIJANI_LANGUAGE_CODE = 'az' |
const BELARUSIAN_LANGUAGE_CODE = 'be' |
const BENGALI_LANGUAGE_CODE = 'bn' |
const BULGARIAN_LANGUAGE_CODE = 'bg' |
const CHINESE_LANGUAGE_CODE = 'zh' |
const CROATIAN_LANGUAGE_CODE = 'hr' |
const CZECH_LANGUAGE_CODE = 'cs' |
const DANISH_LANGUAGE_CODE = 'da' |
const DUTCH_LANGUAGE_CODE = 'nl' |
const ENGLISH_LANGUAGE_CODE = 'en' |
const ESPERANTO_LANGUAGE_CODE = 'eo' |
const ESTONIAN_LANGUAGE_CODE = 'et' |
const EXTRA_LATIN_CHARS_LANGUAGE_CODE = 'latin' |
const EXTRA_MSWORD_CHARS_LANGUAGE_CODE = 'msword' |
const EXTRA_WHITESPACE_CHARS_LANGUAGE_CODE = ' ' |
const FINNISH_LANGUAGE_CODE = 'fi' |
const FRENCH_AUSTRIAN_LANGUAGE_CODE = 'fr_at' |
const FRENCH_LANGUAGE_CODE = 'fr' |
const FRENCH_SWITZERLAND_LANGUAGE_CODE = 'fr_ch' |
const GEORGIAN_LANGUAGE_CODE = 'ka' |
const GERMAN_AUSTRIAN_LANGUAGE_CODE = 'de_at' |
const GERMAN_LANGUAGE_CODE = 'de' |
const GERMAN_SWITZERLAND_LANGUAGE_CODE = 'de_ch' |
const GREEK_LANGUAGE_CODE = 'el' |
const GREEKLISH_LANGUAGE_CODE = 'el__greeklish' |
const HINDI_LANGUAGE_CODE = 'hi' |
const HUNGARIAN_LANGUAGE_CODE = 'hu' |
const ITALIAN_LANGUAGE_CODE = 'it' |
const JAPANESE_LANGUAGE_CODE = 'ja' |
const KAZAKH_LANGUAGE_CODE = 'kk' |
const KIRGHIZ_LANGUAGE_CODE = 'ky' |
const KOREAN_LANGUAGE_CODE = 'ko' |
const LATVIAN_LANGUAGE_CODE = 'lv' |
const LITHUANIAN_LANGUAGE_CODE = 'lt' |
const MACEDONIAN_LANGUAGE_CODE = 'mk' |
const MONGOLIAN_LANGUAGE_CODE = 'mn' |
const MYANMAR_LANGUAGE_CODE = 'my' |
const NORWEGIAN_LANGUAGE_CODE = 'no' |
const ORIYA_LANGUAGE_CODE = 'or' |
const PASHTO_LANGUAGE_CODE = 'ps' |
const PERSIAN_LANGUAGE_CODE = 'fa' |
const POLISH_LANGUAGE_CODE = 'pl' |
const PORTUGUESE_LANGUAGE_CODE = 'pt' |
const ROMANIAN_LANGUAGE_CODE = 'ro' |
const RUSSIAN_GOST_2000_B_LANGUAGE_CODE = 'ru__gost_2000_b' |
const RUSSIAN_LANGUAGE_CODE = 'ru' |
const RUSSIAN_PASSPORT_2013_LANGUAGE_CODE = 'ru__passport_2013' |
const SERBIAN_CYRILLIC_LANGUAGE_CODE = 'sr__cyr' |
const SERBIAN_LANGUAGE_CODE = 'sr' |
const SERBIAN_LATIN_LANGUAGE_CODE = 'sr__lat' |
const SLOVAK_LANGUAGE_CODE = 'sk' |
const SWEDISH_LANGUAGE_CODE = 'sv' |
const THAI_LANGUAGE_CODE = 'th' |
const TURKISH_LANGUAGE_CODE = 'tr' |
const TURKMEN_LANGUAGE_CODE = 'tk' |
const UKRAINIAN_LANGUAGE_CODE = 'uk' |
const UZBEK_LANGUAGE_CODE = 'uz' |
const VIETNAMESE_LANGUAGE_CODE = 'vi' |