php-doc-en/reference/com/dotnet.xml
Christoph Michael Becker cae2755cf9 replaced PHP 4 with PHP 5 constructors
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337059 c90b9560-bf6c-de11-be94-00142212c4b1
2015-06-26 15:10:55 +00:00

90 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.dotnet" xmlns="http://docbook.org/ns/docbook">
<titleabbrev>DOTNET</titleabbrev>
<title>The DOTNET class</title>
<partintro>
<section xml:id="class.dotnet.class">
<title>Description</title>
<simpara>
The DOTNET class allows you to instantiate a class from a .Net assembly and
call its methods and access its properties.
</simpara>
<simpara>
<literal>$obj = new DOTNET("assembly", "classname")</literal>
</simpara>
</section>
<section xml:id="dotnet.dotnet">
<title>Methods</title>
<methodsynopsis>
<methodname>DOTNET::__construct</methodname>
<methodparam><type>string</type><parameter>assembly_name</parameter></methodparam>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>codepage</parameter></methodparam>
</methodsynopsis>
<para>
DOTNET class constructor. <parameter>assembly_name</parameter> specifies
which assembly should be loaded, and <parameter>class_name</parameter>
specifices which class in that assembly to instantiate. You may
optionally specify a <parameter>codepage</parameter> to use for unicode
string transformations; see the <xref linkend="class.com"/> class
for more details on code pages.
</para>
<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>
<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>
<note>
<para>
You need to install the .Net runtime on your web server to take advantage
of this feature.
</para>
</note>
</section>
</partintro>
</phpdoc:classref>
<!-- 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
-->