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 124
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<reference role="class" 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">
<titleabbrev>dotnet</titleabbrev>
<title>The dotnet class</title>
<partintro>
<!-- {{{ dotnet intro -->
<section xml:id="dotnet.intro">
&reftitle.intro;
<para>
The dotnet class allows you to instantiate a class from a .Net assembly and
call its methods and access its properties, if the class and the methods and
properties are <link xlink:href="&url.com.visible;">visible to COM</link>.
</para>
<para>
Neither instantiating static classes nor calling static methods is supported.
Instantiating generic classes such as <literal>System.Collections.Generic.List</literal>
is not supported either.
</para>
<para>
Some .Net classes do not implement IDispatch, so while they can be instantiated,
calling methods or accessing properties on these classes is not supported.
</para>
<note>
<para>
You need to install the .Net runtime on your web server to take advantage
of this feature.
</para>
</note>
<note>
<para>
Prior to PHP 8.0.0, .Net framework 4.0 and later were not supported by the <classname>dotnet</classname>
class. If assemblies had been registered with <command>regasm.exe</command>,
the classes could be instantiated as <classname>com</classname> objects, though.
As of PHP 8.0.0, .Net framework 4.0 and later are supported via the &php.ini;
directive <link linkend="ini.com.dotnet-version">com.dotnet_version</link>.
</para>
</note>
</section>
<!-- }}} -->
<section xml:id="dotnet.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis class="class">
<ooclass>
<classname>dotnet</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>variant</classname>
</ooclass>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<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'])">
<xi:fallback/>
</xi:include>
</classsynopsis>
<!-- }}} -->
</section>
<section xml:id="class.dotnet.overloadedmethods">
<title>Overloaded Methods</title>
<para>
The returned object is an overloaded object, which means that PHP does
not see any fixed methods as it does with regular classes; instead, any
property or method accesses are passed through to COM and from there to
DOTNET. In other words, the .Net object is mapped through the COM
interoperability layer provided by the .Net runtime.
</para>
<para>
Once you have created a dotnet object, PHP treats it identically to any
other COM object; all the same rules apply.
</para>
</section>
<section xml:id="class.dotnet.examples">
<title>dotnet examples</title>
<para>
<example xml:id="example.dotnet">
<title>dotnet example</title>
<programlisting role="php">
<![CDATA[
<?php
$stack = new dotnet("mscorlib", "System.Collections.Stack");
$stack->Push(".Net");
$stack->Push("Hello ");
echo $stack->Pop() . $stack->Pop();
?>
]]>
</programlisting>
</example>
</para>
</section>
</partintro>
&reference.com.entities.dotnet;
</reference>
<!-- 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
-->
|