reference/com/dotnet.xml
14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60
...
...
@@ -1,73 +1,107 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.dotnet" xmlns="http://docbook.org/ns/docbook">
4
-
<titleabbrev>DOTNET</titleabbrev>
5
-
<title>The DOTNET class</title>
3
+
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="class.dotnet">
4
+
<titleabbrev>dotnet</titleabbrev>
5
+
<title>The dotnet class</title>
6
6
<partintro>
7
7

8
-
<section xml:id="class.dotnet.class">
9
-
<title>Description</title>
10
-
<simpara>
11
-
The DOTNET class allows you to instantiate a class from a .Net assembly and
12
-
call its methods and access its properties.
13
-
</simpara>
14
-
<simpara>
15
-
<literal>$obj = new DOTNET("assembly", "classname")</literal>
16
-
</simpara>
17
-
</section>
18
-
<section xml:id="dotnet.dotnet">
19
-
<title>Methods</title>
20
-
<methodsynopsis>
21
-
<methodname>DOTNET::__construct</methodname>
22
-
<methodparam><type>string</type><parameter>assembly_name</parameter></methodparam>
23
-
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
24
-
<methodparam choice="opt"><type>int</type><parameter>codepage</parameter></methodparam>
25
-
</methodsynopsis>
26
-
<para>
27
-
DOTNET class constructor. <parameter>assembly_name</parameter> specifies
28
-
which assembly should be loaded, and <parameter>class_name</parameter>
29
-
specifices which class in that assembly to instantiate. You may
30
-
optionally specify a <parameter>codepage</parameter> to use for unicode
31
-
string transformations; see the <xref linkend="class.com"/> class
32
-
for more details on code pages.
33
-
</para>
34
-
<para>
35
-
The returned object is an overloaded object, which means that PHP does
36
-
not see any fixed methods as it does with regular classes; instead, any
37
-
property or method accesses are passed through to COM and from there to
38
-
DOTNET. In other words, the .Net object is mapped through the COM
39
-
interoperability layer provided by the .Net runtime.
40
-
</para>
41
-
<para>
42
-
Once you have created a DOTNET object, PHP treats it identically to any
43
-
other COM object; all the same rules apply.
44
-
</para>
45
-
<para>
46
-
<example xml:id="example.dotnet">
47
-
<title>DOTNET example</title>
48
-
<programlisting role="php">
8
+
<!-- {{{ dotnet intro -->
9
+
<section xml:id="dotnet.intro">
10
+
&reftitle.intro;
11
+
<para>
12
+
The dotnet class allows you to instantiate a class from a .Net assembly and
13
+
call its methods and access its properties, if the class and the methods and
14
+
properties are <link xlink:href="&url.com.visible;">visible to COM</link>.
15
+
</para>
16
+
<para>
17
+
Neither instantiating static classes nor calling static methods is supported.
18
+
Instantiating generic classes such as <literal>System.Collections.Generic.List</literal>
19
+
is not supported either.
20
+
</para>
21
+
<para>
22
+
Some .Net classes do not implement IDispatch, so while they can be instantiated,
23
+
calling methods or accessing properties on these classes is not supported.
24
+
</para>
25
+
<note>
26
+
<para>
27
+
You need to install the .Net runtime on your web server to take advantage
28
+
of this feature.
29
+
</para>
30
+
</note>
31
+
<note>
32
+
<para>
33
+
Prior to PHP 8.0.0, .Net framework 4.0 and later were not supported by the <classname>dotnet</classname>
34
+
class. If assemblies had been registered with <command>regasm.exe</command>,
35
+
the classes could be instantiated as <classname>com</classname> objects, though.
36
+
As of PHP 8.0.0, .Net framework 4.0 and later are supported via the &php.ini;
37
+
directive <link linkend="ini.com.dotnet-version">com.dotnet_version</link>.
38
+
</para>
39
+
</note>
40
+
</section>
41
+
<!-- }}} -->
42
+

43
+
<section xml:id="dotnet.synopsis">
44
+
&reftitle.classsynopsis;
45
+

46
+
<!-- {{{ Synopsis -->
47
+
<classsynopsis class="class">
48
+
<ooclass>
49
+
<classname>dotnet</classname>
50
+
</ooclass>
51
+

52
+
<ooclass>
53
+
<modifier>extends</modifier>
54
+
<classname>variant</classname>
55
+
</ooclass>
56
+

57
+
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
58
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dotnet')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='dotnet'])">
59
+
<xi:fallback/>
60
+
</xi:include>
61
+
</classsynopsis>
62
+
<!-- }}} -->
63
+

64
+
</section>
65
+

66
+
<section xml:id="class.dotnet.overloadedmethods">
67
+
<title>Overloaded Methods</title>
68
+
<para>
69
+
The returned object is an overloaded object, which means that PHP does
70
+
not see any fixed methods as it does with regular classes; instead, any
71
+
property or method accesses are passed through to COM and from there to
72
+
DOTNET. In other words, the .Net object is mapped through the COM
73
+
interoperability layer provided by the .Net runtime.
74
+
</para>
75
+
<para>
76
+
Once you have created a dotnet object, PHP treats it identically to any
77
+
other COM object; all the same rules apply.
78
+
</para>
79
+
</section>
80
+

81
+
<section xml:id="class.dotnet.examples">
82
+
<title>dotnet examples</title>
83
+
<para>
84
+
<example xml:id="example.dotnet">
85
+
<title>dotnet example</title>
86
+
<programlisting role="php">
49
87
<![CDATA[
50
88
<?php
51
-
$stack = new DOTNET("mscorlib", "System.Collections.Stack");
52
-
$stack->Push(".Net");
53
-
$stack->Push("Hello ");
54
-
echo $stack->Pop() . $stack->Pop();
89
+
$stack = new dotnet("mscorlib", "System.Collections.Stack");
90
+
$stack->Push(".Net");
91
+
$stack->Push("Hello ");
92
+
echo $stack->Pop() . $stack->Pop();
55
93
?>
56
94
]]>
57
-
</programlisting>
58
-
</example>
59
-
</para>
60
-
<note>
61
-
<para>
62
-
You need to install the .Net runtime on your web server to take advantage
63
-
of this feature.
95
+
</programlisting>
96
+
</example>
64
97
</para>
65
-
</note>
66
-
</section>
98
+
</section>
67
99

68
100
</partintro>
69
-
</phpdoc:classref>
70
101

102
+
&reference.com.entities.dotnet;
103
+

104
+
</phpdoc:classref>
71
105
<!-- Keep this comment at the end of the file
72
106
Local variables:
73
107
mode: sgml
74
108