reference/com/functions/com-event-sink.xml
20216b916ed583938672cd09c2c2f430351430d1
...
...
@@ -9,14 +9,14 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>com_event_sink</methodname>
12
-
<methodparam><type>variant</type><parameter>comobject</parameter></methodparam>
13
-
<methodparam><type>object</type><parameter>sinkobject</parameter></methodparam>
14
-
<methodparam choice="opt"><type>mixed</type><parameter>sinkinterface</parameter></methodparam>
12
+
<methodparam><type>variant</type><parameter>variant</parameter></methodparam>
13
+
<methodparam><type>object</type><parameter>sink_object</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>sink_interface</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Instructs COM to sink events generated by
18
-
<parameter>comobject</parameter> into the PHP object
19
-
<parameter>sinkobject</parameter>.
18
+
<parameter>variant</parameter> into the PHP object
19
+
<parameter>sink_object</parameter>.
20
20
</para>
21
21
<para>
22
22
Be careful how you use this feature; if you are doing something similar
...
...
@@ -29,17 +29,17 @@
29
29
<para>
30
30
<variablelist>
31
31
<varlistentry>
32
-
<term><parameter>comobject</parameter></term>
32
+
<term><parameter>variant</parameter></term>
33
33
<listitem>
34
34
<para>
35
35
</para>
36
36
</listitem>
37
37
</varlistentry>
38
38
<varlistentry>
39
-
<term><parameter>sinkobject</parameter></term>
39
+
<term><parameter>sink_object</parameter></term>
40
40
<listitem>
41
41
<para>
42
-
<parameter>sinkobject</parameter> should be an instance of a class with
42
+
<parameter>sink_object</parameter> should be an instance of a class with
43
43
methods named after those of the desired dispinterface; you may use
44
44
<function>com_print_typeinfo</function> to help generate a template class
45
45
for this purpose.
...
...
@@ -47,13 +47,13 @@
47
47
</listitem>
48
48
</varlistentry>
49
49
<varlistentry>
50
-
<term><parameter>sinkinterface</parameter></term>
50
+
<term><parameter>sink_interface</parameter></term>
51
51
<listitem>
52
52
<para>
53
53
PHP will attempt to use the default dispinterface type specified by
54
-
the typelibrary associated with <parameter>comobject</parameter>, but
54
+
the typelibrary associated with <parameter>variant</parameter>, but
55
55
you may override this choice by setting
56
-
<parameter>sinkinterface</parameter> to the name of the dispinterface
56
+
<parameter>sink_interface</parameter> to the name of the dispinterface
57
57
that you want to use.
58
58
</para>
59
59
</listitem>
...
...
@@ -67,6 +67,29 @@
67
67
&return.success;
68
68
</para>
69
69
</refsect1>
70
+

71
+
<refsect1 role="changelog">
72
+
&reftitle.changelog;
73
+
<informaltable>
74
+
<tgroup cols="2">
75
+
<thead>
76
+
<row>
77
+
<entry>&Version;</entry>
78
+
<entry>&Description;</entry>
79
+
</row>
80
+
</thead>
81
+
<tbody>
82
+
<row>
83
+
<entry>8.0.0</entry>
84
+
<entry>
85
+
<parameter>sink_interface</parameter> is nullable now.
86
+
</entry>
87
+
</row>
88
+
</tbody>
89
+
</tgroup>
90
+
</informaltable>
91
+
</refsect1>
92
+

70
93
<refsect1 role="examples">
71
94
&reftitle.examples;
72
95
<para>
...
...
@@ -92,7 +115,6 @@ class IEEventSinker {
92
115
}
93
116
}
94
117
$ie = new COM("InternetExplorer.Application");
95
-
// note that you don't need the & for PHP 5!
96
118
$sink = new IEEventSinker();
97
119
com_event_sink($ie, $sink, "DWebBrowserEvents2");
98
120
$ie->Visible = true;
...
...
@@ -107,6 +129,19 @@ $ie = null;
107
129
</example>
108
130
</para>
109
131
</refsect1>
132
+

133
+
<refsect1 role="notes">
134
+
&reftitle.notes;
135
+
<caution>
136
+
<para>
137
+
Prior to PHP 8.0.0, calling <function>exit</function> from any of the event
138
+
handlers is not supported, and may cause PHP to hang. This can be worked around
139
+
by throwing an exception from the event handler, catching the exception in
140
+
the main code, and calling <function>exit</function> from there.
141
+
</para>
142
+
</caution>
143
+
</refsect1>
144
+

110
145
<refsect1 role="seealso">
111
146
&reftitle.seealso;
112
147
<para>
...
...
@@ -117,7 +152,6 @@ $ie = null;
117
152
</para>
118
153
</refsect1>
119
154
</refentry>
120
-

121
155
<!-- Keep this comment at the end of the file
122
156
Local variables:
123
157
mode: sgml
124
158