reference/gnupg/functions/gnupg-init.xml
62d996960c151af77561894545850ac394cf872c
...
...
@@ -10,13 +10,56 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>resource</type><methodname>gnupg_init</methodname>
13
-
<void />
13
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
</refsect1>
16
16

17
17
<refsect1 role="parameters">
18
18
&reftitle.parameters;
19
-
&no.function.parameters;
19
+
<para>
20
+
<variablelist>
21
+
<varlistentry>
22
+
<term><parameter>options</parameter></term>
23
+
<listitem>
24
+
<para>
25
+
Must be an associative array. It is used to change the default configuration
26
+
of the crypto engine.
27
+
<table>
28
+
<title>Configuration overrides</title>
29
+
<tgroup cols="3">
30
+
<thead>
31
+
<row>
32
+
<entry>key</entry>
33
+
<entry>type</entry>
34
+
<entry>description</entry>
35
+
</row>
36
+
</thead>
37
+
<tbody>
38
+
<row>
39
+
<entry>file_name</entry>
40
+
<entry><type>string</type></entry>
41
+
<entry>
42
+
It is the file name of the executable program implementing this protocol
43
+
which is usually path of the <literal>gpg</literal> executable.
44
+
</entry>
45
+
</row>
46
+
<row>
47
+
<entry>home_dir</entry>
48
+
<entry><type>string</type></entry>
49
+
<entry>
50
+
It is the directory name of the configuration directory. It also overrides
51
+
<literal>GNUPGHOME</literal> environment variable that is used for the same
52
+
purpose.
53
+
</entry>
54
+
</row>
55
+
</tbody>
56
+
</tgroup>
57
+
</table>
58
+
</para>
59
+
</listitem>
60
+
</varlistentry>
61
+
</variablelist>
62
+
</para>
20
63
</refsect1>
21
64

22
65
<refsect1 role="returnvalues">
...
...
@@ -26,11 +69,31 @@
26
69
</para>
27
70
</refsect1>
28
71

72
+
<refsect1 role="changelog">
73
+
&reftitle.changelog;
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>1.5.0</entry>
85
+
<entry>The <parameter>options</parameter> parameter was added.</entry>
86
+
</row>
87
+
</tbody>
88
+
</tgroup>
89
+
</informaltable>
90
+
</refsect1>
91
+

29
92
<refsect1 role="examples">
30
93
&reftitle.examples;
31
94
<para>
32
95
<example>
33
-
<title>Procedural <function>gnupg_init</function> example</title>
96
+
<title>Procedural <function>gnupg_init</function> example with default setting</title>
34
97
<programlisting role="php">
35
98
<![CDATA[
36
99
<?php
...
...
@@ -40,7 +103,17 @@ $res = gnupg_init();
40
103
</programlisting>
41
104
</example>
42
105
<example>
43
-
<title>OO gnupg initializer example</title>
106
+
<title>Procedural <function>gnupg_init</function> example with overriden file name and home dir</title>
107
+
<programlisting role="php">
108
+
<![CDATA[
109
+
<?php
110
+
$res = gnupg_init(["file_name" => "/usr/bin/gpg2", "home_dir" => "/var/www/.gnupg"]);
111
+
?>
112
+
]]>
113
+
</programlisting>
114
+
</example>
115
+
<example>
116
+
<title>OO gnupg initializer example with default setting</title>
44
117
<programlisting role="php">
45
118
<![CDATA[
46
119
<?php
...
...
@@ -49,10 +122,19 @@ $gpg = new gnupg();
49
122
]]>
50
123
</programlisting>
51
124
</example>
125
+
<example>
126
+
<title>OO gnupg initializer example with overriden file name and home dir</title>
127
+
<programlisting role="php">
128
+
<![CDATA[
129
+
<?php
130
+
$gpg = new gnupg(["file_name" => "/usr/bin/gpg2", "home_dir" => "/var/www/.gnupg"]);
131
+
?>
132
+
]]>
133
+
</programlisting>
134
+
</example>
52
135
</para>
53
136
</refsect1>
54
137
</refentry>
55
-

56
138
<!-- Keep this comment at the end of the file
57
139
Local variables:
58
140
mode: sgml
59
141