-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathini-get.xml
More file actions
123 lines (118 loc) · 3.61 KB
/
ini-get.xml
File metadata and controls
123 lines (118 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
<!-- splitted from ./en/functions/info.xml, last change in rev 1.64 -->
<refentry xml:id="function.ini-get" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ini_get</refname>
<refpurpose>Restituisce il valore delle opzioni di configurazione</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</title>
<methodsynopsis>
<type>string</type><methodname>ini_get</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
</methodsynopsis>
<para>
Restituisce il valore delle opzioni di configurazione. In caso di errore, tipo
la richiesta per un valore inesistente, sarà restituita una stringa vuota.
</para>
<note>
<title>Richieste per valori booleani</title>
<para>
Nel file ini, il valore booleano <literal>off</literal> sarà restituito come
stringa vuota o "0", mentre il valore <literal>on</literal> sarà restituito come
"1".
</para>
</note>
<note>
<title>Richieste per le dimensioni della memoria</title>
<para>
Diversi parametri attinenti alle dimensioni di memoria, tipo
<link linkend="ini.upload-max-filesize">upload_max_filesize</link>
sono registrati nel &php.ini; in notazione abbreviata. La funzione <function>ini_get</function>
restituirà l'esatto valore presente nel &php.ini;, e <emphasis>NON</emphasis>
l'<type>intero</type> equivalente. L'esecuzione delle normali funzioni aritmetiche su questi valori
potrà dare risultati inattesi. L'esempio seguente illustra come
si possa convertire la notazione breve in byte in modo molto simile a come
fa il PHP.
</para>
</note>
<para>
<example>
<title>Qualche esempio di <function>ini_get</function></title>
<programlisting role="php">
<![CDATA[
<?php
/*
Il nostro php.ini contiene i seguenti parametri:
display_errors = On
register_globals = Off
post_max_size = 8M
*/
echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . ini_get('register_globals') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . "\n";
echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));
function return_bytes($val) {
$val = trim($val);
$last = $val{strlen($val)-1};
switch($last) {
case 'k':
case 'K':
return (int) $val * 1024;
break;
case 'm':
case 'M':
return (int) $val * 1048576;
break;
default:
return $val;
}
}
?>
]]>
</programlisting>
<para>
Lo script produrrà:
</para>
<screen>
<![CDATA[
display_errors = 1
register_globals = 0
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608
]]>
</screen>
</example>
</para>
<para>
Vedere anche:
<function>get_cfg_var</function>,
<function>ini_get_all</function>,
<function>ini_restore</function> e
<function>ini_set</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->