ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Json.php
Go to the documentation of this file.
1
<?
php
2
namespace
Gettext\Languages\Exporter
;
3
4
class
Json
extends
Exporter
5
{
10
protected
static
function
getEncodeOptions
()
11
{
12
$result
= 0;
13
if
(defined(
'\JSON_UNESCAPED_SLASHES'
)) {
14
$result
|= \JSON_UNESCAPED_SLASHES;
15
}
16
if
(defined(
'\JSON_UNESCAPED_UNICODE'
)) {
17
$result
|= \JSON_UNESCAPED_UNICODE;
18
}
19
20
return
$result
;
21
}
25
protected
static
function
toStringDo
(
$languages
)
26
{
27
$list
= array();
28
foreach
(
$languages
as
$language
) {
29
$item = array();
30
$item[
'name'
] =
$language
->name;
31
if
(isset(
$language
->supersededBy)) {
32
$item[
'supersededBy'
] =
$language
->supersededBy;
33
}
34
if
(isset(
$language
->script)) {
35
$item[
'script'
] =
$language
->script;
36
}
37
if
(isset(
$language
->territory)) {
38
$item[
'territory'
] =
$language
->territory;
39
}
40
if
(isset(
$language
->baseLanguage)) {
41
$item[
'baseLanguage'
] =
$language
->baseLanguage;
42
}
43
$item[
'formula'
] =
$language
->formula;
44
$item[
'plurals'
] = count(
$language
->categories);
45
$item[
'cases'
] = array();
46
$item[
'examples'
] = array();
47
foreach
(
$language
->categories as $category) {
48
$item[
'cases'
][] = $category->id;
49
$item[
'examples'
][$category->id] = $category->examples;
50
}
51
$list
[
$language
->id] = $item;
52
}
53
54
return
json_encode(
$list
, static::getEncodeOptions());
55
}
59
public
static
function
getDescription
()
60
{
61
return
'Build a compressed JSON-encoded file'
;
62
}
63
}
$result
$result
Definition:
CleanUpTest.php:463
php
An exception for terminatinating execution or to throw for unit testing.
Gettext\Languages\Exporter\Exporter
Base class for all the exporters.
Definition:
Exporter.php:11
Gettext\Languages\Exporter\Json
Definition:
Json.php:5
Gettext\Languages\Exporter\Json\toStringDo
static toStringDo($languages)
Definition:
Json.php:25
Gettext\Languages\Exporter\Json\getEncodeOptions
static getEncodeOptions()
Return the options for json_encode.
Definition:
Json.php:10
Gettext\Languages\Exporter\Json\getDescription
static getDescription()
Definition:
Json.php:59
$languages
$languages
Definition:
cssgen2.php:34
$language
$language
Definition:
frontpage_federation.php:120
Gettext\Languages\Exporter
Definition:
Docs.php:2
$list
if(isset($_REQUEST['delete'])) $list
Definition:
registry.php:41
libs
composer
vendor
gettext
languages
src
Exporter
Json.php
Generated on Thu Oct 2 2025 19:01:04 for ILIAS by
1.9.4 (using
Doxyfile
)