ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Php.php
Go to the documentation of this file.
1
<?
php
2
namespace
Gettext\Languages\Exporter
;
3
4
class
Php
extends
Exporter
5
{
9
protected
static
function
toStringDo
($languages)
10
{
11
$lines = array();
12
$lines[] =
'<?php'
;
13
$lines[] =
'return array('
;
14
foreach
($languages as
$lc
) {
15
$lines[] =
' \''
.$lc->id.
'\'
=> array(
';
16
$lines[] = '
\
'name\' => \''
.addslashes(
$lc
->name).
'\'
,
';
17
if (isset($lc->supersededBy)) {
18
$lines[] = '
\
'supersededBy\' => \''
.$lc->supersededBy.
'\'
,
';
19
}
20
if (isset($lc->script)) {
21
$lines[] = '
\
'script\' => \''
.addslashes(
$lc
->script).
'\'
,
';
22
}
23
if (isset($lc->territory)) {
24
$lines[] = '
\
'territory\' => \''
.addslashes(
$lc
->territory).
'\'
,
';
25
}
26
if (isset($lc->baseLanguage)) {
27
$lines[] = '
\
'baseLanguage\' => \''
.addslashes(
$lc
->baseLanguage).
'\'
,
';
28
}
29
$lines[] = '
\
'formula\' => \''
.$lc->formula.
'\'
,
';
30
$lines[] = '
\
'plurals\' => '
.count(
$lc
->categories).
','
;
31
$catNames = array();
32
foreach
(
$lc
->categories as $c) {
33
$catNames[] =
"'{$c->id}'"
;
34
}
35
$lines[] =
' \'cases\' => array('
.implode(
', '
, $catNames).
'),'
;
36
$lines[] =
' \'examples\' => array('
;
37
foreach
(
$lc
->categories as $c) {
38
$lines[] =
' \''
.$c->id.
'\' => \''
.$c->examples.
'\','
;
39
}
40
$lines[] =
' ),'
;
41
$lines[] =
' ),'
;
42
}
43
$lines[] =
');'
;
44
$lines[] =
''
;
45
46
return
implode(
"\n"
, $lines);
47
}
51
public
static
function
getDescription
()
52
{
53
return
'Build a PHP array'
;
54
}
55
}
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\Exporter\getDescription
static getDescription()
Return a short description of the exporter.
Definition:
Exporter.php:124
Gettext\Languages\Exporter\Php
Definition:
Php.php:5
Gettext\Languages\Exporter\Php\toStringDo
static toStringDo($languages)
Definition:
Php.php:9
foreach
foreach( $files as $file)
Definition:
config-scanner.php:63
$lc
$lc
Definition:
date.php:267
Gettext\Languages\Exporter
Definition:
Docs.php:2
libs
composer
vendor
gettext
languages
src
Exporter
Php.php
Generated on Tue Sep 30 2025 19:00:53 for ILIAS by
1.9.4 (using
Doxyfile
)