|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Go to the source code of this file.
Variables | |
| if(PHP_SAPI !=='cli') | $repo_root = dirname(__DIR__, 5) |
Generates the enum of the language identifiers of one module (an implementation of ILIAS\Language\LanguageIdentifier, see Language::txt()) from the module's .pot, or checks an existing one against it (–check, for CI). More... | |
| const | LANGUAGE_IDENTIFIER_ENUM_TOOL = 'components/ILIAS/Language/tools/language-identifier-enum/generate_language_identifier_enum.php' |
| $fail | |
| $printable | |
| Makes control characters visible in everything printed that comes from a file or the command line. More... | |
| $identifier_format = '/^[A-Za-z_][A-Za-z0-9_]*$/' | |
| $reserved_case_names = ['CLASS', '__HALT_COMPILER'] | |
| Case names PHP rejects (all other keywords are allowed as names of class constants and cases). More... | |
| $comment_safe = static fn(string $text): string => str_replace('*/', '*\\/', $text) | |
| $inside_repository | |
The absolute path of $path if it lies inside $root, null otherwise. More... | |
| $case_names | |
| $render | |
| $case_names |
| list<string> | $identifiers |
Definition at line 125 of file generate_language_identifier_enum.php.
| $comment_safe = static fn(string $text): string => str_replace('*/', '*\\/', $text) |
Definition at line 85 of file generate_language_identifier_enum.php.
| $fail |
Definition at line 64 of file generate_language_identifier_enum.php.
Referenced by ilAdvancedMDSettingsGUI\deleteFields(), ilAdvancedMDSettingsGUI\deleteRecords(), ilAdvancedMDSettingsGUI\exportRecords(), ilObjWorkspaceFolderGUI\performPasteIntoMultipleObjects(), StandardFormTest\testRenderWithErrorOnField(), StandardFormTest\testRenderWithErrorOnForm(), and ILIAS\Tests\Refinery\Parser\ABNF\BrickTest\testRepeat().
| $identifier_format = '/^[A-Za-z_][A-Za-z0-9_]*$/' |
Definition at line 78 of file generate_language_identifier_enum.php.
| $inside_repository |
The absolute path of $path if it lies inside $root, null otherwise.
Symbolic links of the deepest existing ancestor are resolved; the non-existing rest must not contain "." or "..".
Definition at line 91 of file generate_language_identifier_enum.php.
| $printable |
Makes control characters visible in everything printed that comes from a file or the command line.
Definition at line 72 of file generate_language_identifier_enum.php.
| $render |
| array<string,string> | $names identifier => case name |
Definition at line 172 of file generate_language_identifier_enum.php.
Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\SelfRegistration\guis(), and ILIAS\DataProtection\Consumer\showMatchingDocument().
| if (PHP_SAPI !=='cli') $repo_root = dirname(__DIR__, 5) |
Generates the enum of the language identifiers of one module (an implementation of ILIAS\Language\LanguageIdentifier, see Language::txt()) from the module's .pot, or checks an existing one against it (–check, for CI).
See README.md next to this file.
Usage: php generate_language_identifier_enum.php [–check | –stdout] [–module=<module>] –namespace=<Namespace> <pot file> <enum file> <pot file> the .pot of the module, inside this ILIAS directory <enum file> the enum, "<EnumName>.php", inside this ILIAS directory - written atomically (its directory must exist), with –stdout only printed, with –check only read –module the module (default: the "X-Domain" header of the .pot, else its file name) –namespace the namespace of the enum, e.g. "ILIAS\Poll" –check compares the enum with the .pot: missing or surplus cases, wrong values, wrong module - exit code 1 if it deviates. For an enum without cases, module() must return a single-quoted string literal (it cannot be called without a case). Exit codes: 0 success (no deviation), 1 deviation (–check), 2 invalid arguments or input.
Case names: the identifier in upper case, every run of characters other than A-Z, 0-9 and "_" replaced by one "_", a leading digit and the names PHP does not allow for a case (CLASS, __HALT_COMPILER) prefixed with "KEY_". Identifiers that end up with the same name (e.g. "style" and "Style") are numbered deterministically: the identifier in lower case keeps the name, the others (in byte order) get "_2", "_3", ... (skipping every name taken otherwise) - reported on stderr. One case per msgid, plural messages included.
Deliberately declares no named classes or functions: this file lives inside the classmap-scanned components/ tree (see convert_module_to_po.php).
Definition at line 54 of file generate_language_identifier_enum.php.
| $reserved_case_names = ['CLASS', '__HALT_COMPILER'] |
Case names PHP rejects (all other keywords are allowed as names of class constants and cases).
Definition at line 83 of file generate_language_identifier_enum.php.
| const LANGUAGE_IDENTIFIER_ENUM_TOOL = 'components/ILIAS/Language/tools/language-identifier-enum/generate_language_identifier_enum.php' |
Definition at line 62 of file generate_language_identifier_enum.php.