Skip to content

Commit 564a19d

Browse files
authored
info sync with EN (#1995)
1 parent 84f7f3e commit 564a19d

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

reference/info/functions/ini-get.xml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: c8a8981a9df9a1564a4b9a79e84583d41a7b6ac5 Maintainer: yannick Status: ready -->
3+
<!-- EN-Revision: 4c016ab334b90a98258b98e04752af7dc74954cd Maintainer: yannick Status: ready -->
44
<!-- Reviewed: yes -->
55

66
<refentry xml:id="function.ini-get" xmlns="http://docbook.org/ns/docbook">
@@ -60,37 +60,15 @@
6060
Notre fichier php.ini contient les directives suivantes :
6161
6262
display_errors = On
63-
register_globals = Off
63+
opcache.enable_cli = Off
6464
post_max_size = 8M
6565
*/
6666
6767
echo 'display_errors = ' . ini_get('display_errors') . "\n";
68-
echo 'register_globals = ' . (int) ini_get('register_globals') . "\n";
68+
echo 'opcache.enable_cli = ' . (int) ini_get('opcache.enable_cli') . "\n";
6969
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
7070
echo 'post_max_size + 1 = ' . (rtrim(ini_get('post_max_size'), 'KMG') + 1) . "\n";
71-
echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));
72-
73-
function return_bytes($val)
74-
{
75-
$val = trim($val);
76-
$num = (int) rtrim($val, 'KMG');
77-
$last = strtolower($val[strlen($val) - 1]);
78-
79-
switch ($last) {
80-
// Le modifieur 'G' est disponible
81-
case 'g':
82-
$num = $num * 1024 * 1024 * 1024;
83-
break;
84-
case 'm':
85-
$num = $num * 1024 * 1024;
86-
break;
87-
case 'k':
88-
$num *= 1024;
89-
break;
90-
}
91-
92-
return $num;
93-
}
71+
echo 'post_max_size in bytes = ' . ini_parse_quantity(ini_get('post_max_size'));
9472
9573
?>
9674
]]>
@@ -100,7 +78,7 @@ function return_bytes($val)
10078
<![CDATA[
10179
10280
display_errors = 1
103-
register_globals = 0
81+
opcache.enable_cli = 0
10482
post_max_size = 8M
10583
post_max_size+1 = 9
10684
post_max_size in bytes = 8388608
@@ -131,9 +109,9 @@ post_max_size in bytes = 8388608
131109
dans le fichier &php.ini; avec une notation courte. <function>ini_get</function>
132110
retourne la chaîne exacte stockée dans le fichier &php.ini; et
133111
<emphasis>NON PAS</emphasis> son équivalent &integer;. Appliquer des opérations
134-
arithmétiques classiques sur ces valeurs ne conduira à rien de bon. L'exemple ci-dessous
135-
montre une façon de convertir la notation sténographique en octets, de la même
136-
façon dont le fait le source PHP.
112+
arithmétiques classiques sur ces valeurs ne conduira à rien de bon. La fonction
113+
<function>ini_parse_quantity</function> peut être utilisée pour convertir
114+
la notation abrégée en octets.
137115
</para>
138116
</note>
139117
<note>
@@ -150,6 +128,7 @@ post_max_size in bytes = 8388608
150128
<simplelist>
151129
<member><function>get_cfg_var</function></member>
152130
<member><function>ini_get_all</function></member>
131+
<member><function>ini_parse_quantity</function></member>
153132
<member><function>ini_restore</function></member>
154133
<member><function>ini_set</function></member>
155134
</simplelist>

reference/info/functions/ini-parse-quantity.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 701b63e2cc52908643e16f61ebbc26d9fabbd77a Maintainer: Fan2Shrek Status: ready -->
2+
<!-- EN-Revision: 4c016ab334b90a98258b98e04752af7dc74954cd Maintainer: Fan2Shrek Status: ready -->
33
<!-- Reviewed: yes -->
44
<refentry xml:id="function.ini-parse-quantity" xmlns="http://docbook.org/ns/docbook">
55
<refnamediv>
@@ -78,7 +78,7 @@ var_dump(ini_parse_quantity('10F'));
7878
?>
7979
]]>
8080
</programlisting>
81-
&example.outputs.similar;
81+
&example.outputs;
8282
<screen>
8383
<![CDATA[
8484

0 commit comments

Comments
 (0)