reference/ibase/functions/ibase-server-info.xml
4d8da419011b34623bc91aab8d5ef7f5b6bfb128
...
...
@@ -13,8 +13,108 @@
13
13
<methodparam><type>resource</type><parameter>service_handle</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>action</parameter></methodparam>
15
15
</methodsynopsis>
16
+
</refsect1>
17
+
18
+
<refsect1 role="parameters">
19
+
&reftitle.parameters;
20
+
<para>
21
+
<variablelist>
22
+
<varlistentry>
23
+
<term><parameter>service_handle</parameter></term>
24
+
<listitem>
25
+
<para>
26
+
A previously created connection to the database server.
27
+
</para>
28
+
</listitem>
29
+
</varlistentry>
30
+
<varlistentry>
31
+
<term><parameter>action</parameter></term>
32
+
<listitem>
33
+
<para>
34
+
A valid constant.
35
+
</para>
36
+
</listitem>
37
+
</varlistentry>
38
+
</variablelist>
39
+
</para>
40
+
</refsect1>
41
+

42
+
<refsect1 role="returnvalues">
43
+
&reftitle.returnvalues;
44
+
<para>
45
+
Returns mixed types depending on context.
46
+
</para>
47
+
</refsect1>
48
+
49
+
<refsect1 role="examples">
50
+
&reftitle.examples;
51
+
<para>
52
+
<example>
53
+
<title><function>ibase_service_attach</function> example</title>
54
+
<programlisting role="php">
55
+
<![CDATA[
56
+
<?php
57
+
// Attach to the remote Firebird server
58
+
if (($service = ibase_service_attach('10.1.1.254/3050', 'sysdba', 'masterkey')) != FALSE) {
59
+

60
+
// Successfully attached.
61
+

62
+
// Output the info
63
+
echo "Server version: " . ibase_server_info($service, IBASE_SVC_SERVER_VERSION) . "\n";
64
+
echo "Server implementation: " . ibase_server_info($service, IBASE_SVC_IMPLEMENTATION) . "\n";
65
+
echo "Server users: " . print_r(ibase_server_info($service, IBASE_SVC_GET_USERS), true) . "\n";
66
+
echo "Server directory: " . ibase_server_info($service, IBASE_SVC_GET_ENV) . "\n";
67
+
echo "Server lock path: " . ibase_server_info($service, IBASE_SVC_GET_ENV_LOCK) . "\n";
68
+
echo "Server lib path: " . ibase_server_info($service, IBASE_SVC_GET_ENV_MSG) . "\n";
69
+
echo "Path of user db: " . ibase_server_info($service, IBASE_SVC_USER_DBPATH) . "\n";
70
+
echo "Established connections: " . print_r(ibase_server_info($service, IBASE_SVC_SVR_DB_INFO),true) . "\n";
71
+

72
+
// Detach from server (disconnect)
73
+
ibase_service_detach($service);
74
+

75
+
}
76
+
else {
77
+
// Output message on error
78
+
$conn_error = ibase_errmsg();
79
+
die($conn_error);
80
+
}
81
+
?>
82
+
]]>
83
+
</programlisting>
84
+
&example.outputs;
85
+
<screen>
86
+
<![CDATA[
87
+
Server version: LI-V3.0.4.33054 Firebird 3.0
88
+
Server implementation: Firebird/Linux/AMD/Intel/x64
89
+
Server users: Array
90
+
(
91
+
[0] => Array
92
+
(
93
+
[user_name] => SYSDBA
94
+
[first_name] => Sql
95
+
[middle_name] => Server
96
+
[last_name] => Administrator
97
+
[user_id] => 0
98
+
[group_id] => 0
99
+
)
100
+

101
+
)
16
102

17
-
&warn.undocumented.func;
103
+
Server directory: /etc/firebird/
104
+
Server lock path: /tmp/firebird/
105
+
Server lib path: /usr/lib64/firebird/lib/
106
+
Path of user db: /var/lib/firebird/secdb/security3.fdb
107
+
Established connections: Array
108
+
(
109
+
[attachments] => 3
110
+
[databases] => 2
111
+
[0] => /srv/firebird/poss.fdb
112
+
[1] => /srv/firebird/employees.fdb
113
+
)
114
+
]]>
115
+
</screen>
116
+
</example>
117
+
</para>
18
118

19
119
</refsect1>
20
120

21
121