Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

info sync with EN #1995

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 9 additions & 30 deletions reference/info/functions/ini-get.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: c8a8981a9df9a1564a4b9a79e84583d41a7b6ac5 Maintainer: yannick Status: ready -->
<!-- EN-Revision: 4c016ab334b90a98258b98e04752af7dc74954cd Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->

<refentry xml:id="function.ini-get" xmlns="http://docbook.org/ns/docbook">
Expand Down Expand Up @@ -60,37 +60,15 @@
Notre fichier php.ini contient les directives suivantes :

display_errors = On
register_globals = Off
opcache.enable_cli = Off
post_max_size = 8M
*/

echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . (int) ini_get('register_globals') . "\n";
echo 'opcache.enable_cli = ' . (int) ini_get('opcache.enable_cli') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size + 1 = ' . (rtrim(ini_get('post_max_size'), 'KMG') + 1) . "\n";
echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));

function return_bytes($val)
{
$val = trim($val);
$num = (int) rtrim($val, 'KMG');
$last = strtolower($val[strlen($val) - 1]);

switch ($last) {
// Le modifieur 'G' est disponible
case 'g':
$num = $num * 1024 * 1024 * 1024;
break;
case 'm':
$num = $num * 1024 * 1024;
break;
case 'k':
$num *= 1024;
break;
}

return $num;
}
echo 'post_max_size in bytes = ' . ini_parse_quantity(ini_get('post_max_size'));

?>
]]>
Expand All @@ -100,7 +78,7 @@ function return_bytes($val)
<![CDATA[

display_errors = 1
register_globals = 0
opcache.enable_cli = 0
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608
Expand Down Expand Up @@ -131,9 +109,9 @@ post_max_size in bytes = 8388608
dans le fichier &php.ini; avec une notation courte. <function>ini_get</function>
retourne la chaîne exacte stockée dans le fichier &php.ini; et
<emphasis>NON PAS</emphasis> son équivalent &integer;. Appliquer des opérations
arithmétiques classiques sur ces valeurs ne conduira à rien de bon. L'exemple ci-dessous
montre une façon de convertir la notation sténographique en octets, de la même
façon dont le fait le source PHP.
arithmétiques classiques sur ces valeurs ne conduira à rien de bon. La fonction
<function>ini_parse_quantity</function> peut être utilisée pour convertir
la notation abrégée en octets.
</para>
</note>
<note>
Expand All @@ -150,6 +128,7 @@ post_max_size in bytes = 8388608
<simplelist>
<member><function>get_cfg_var</function></member>
<member><function>ini_get_all</function></member>
<member><function>ini_parse_quantity</function></member>
<member><function>ini_restore</function></member>
<member><function>ini_set</function></member>
</simplelist>
Expand Down
4 changes: 2 additions & 2 deletions reference/info/functions/ini-parse-quantity.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 701b63e2cc52908643e16f61ebbc26d9fabbd77a Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 4c016ab334b90a98258b98e04752af7dc74954cd Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.ini-parse-quantity" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -78,7 +78,7 @@ var_dump(ini_parse_quantity('10F'));
?>
]]>
</programlisting>
&example.outputs.similar;
&example.outputs;
<screen>
<![CDATA[

Expand Down