Document PHP 4 and PHP 5 stuff in the COM extension.

# win32 users, you all owe me beer ;)


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@157837 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Wez Furlong 2004-05-03 14:55:02 +00:00
parent 1853be1cd6
commit 1f1450f2f7
49 changed files with 2964 additions and 91 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<section id="com.constants">
&reftitle.constants;
&extension.constants;
@ -400,6 +400,67 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>VARCMP_LT</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>VARCMP_EQ</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>VARCMP_GT</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>VARCMP_NULL</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNORECASE</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNORENONSPACE</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNORESYMBOLS</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNOREWIDTH</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNOREKANATYPE</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>NORM_IGNOREKASHIDA</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>DISP_E_DIVBYZERO</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
<varlistentry>
<term><constant>DISP_E_OVERFLOW</constant> (<type>integer</type>)</term>
<listitem><simpara></simpara></listitem>
</varlistentry>
</variablelist>
</section>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.12 -->
<refentry id="class.com">
<refnamediv>
@ -7,57 +7,252 @@
<refpurpose>COM class</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>$obj = new <classname>COM</classname>("server.object")</synopsis>
<synopsis>$obj = new <classname>COM</classname>("Application.ID")</synopsis>
</refsynopsisdiv>
<refsect1 id="class.com.class">
<title>Description</title>
<simpara>
The COM class provides a framework to integrate (D)COM components into
your PHP scripts.
The COM class allows you to instantiate an OLE compatible COM object and
call its methods and access its properties.
</simpara>
</refsect1>
<refsect1 id="class.com.constructor">
<title>Methods</title>
<methodsynopsis>
<type>string</type><methodname>COM::COM</methodname>
<type>object</type><methodname>COM::COM</methodname>
<methodparam><type>string</type><parameter>module_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>server_name</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>server_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>codepage</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>typelib</parameter></methodparam>
</methodsynopsis>
<para>
COM class constructor. Parameters:
COM class constructor. The parameters have the following meanings:
<variablelist>
<varlistentry><term>module_name</term>
<listitem>
<simpara>
name or class-id of the requested component.
Can be a ProgID, Class ID or Moniker that names the component to load.
</simpara>
<simpara>
A ProgID is typically the application or DLL name, followed by a period,
followed by the object name. e.g: <literal>Word.Application</literal>.
</simpara>
<simpara>
A Class ID is the UUID that uniquely identifies a given class.
</simpara>
<simpara>
A Moniker is a special form of naming, similar in concept to a URL
scheme, that identifies a resource and specifies how it should be
loaded. As an example, you could load up Word and get an object
representing a word document by specifying the full path to the word
document as the module name, or you can use <literal>LDAP:</literal> as
a moniker to use the ADSI interface to LDAP.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>server_name</term>
<listitem>
<simpara>
name of the DCOM server from which the component should be fetched.
If &null;, <literal>localhost</literal> is assumed.
To allow DCOM <constant>com.allow_dcom</constant> has to be set to
&true; in &php.ini;.
The name of the DCOM server on which the component should be loaded and
run. If &null;, the object is run using the default for the
application. The default is typically to run it on the local machine,
although the administrator might have configured the application to
launch on a different machine.
</simpara>
<simpara>
If you specify a non-&null; value for server, PHP will refuse to load
the object unless the <xref
linkend="ini.com.allow-dcom"/> configuration option
is set to &true;.
</simpara>
<para>
If <parameter>server_name</parameter> is an array, it should contain the
following elements (case sensitive!). Note that they are all optional
(although you need to specify both Username and Password together); if
you omit the Server setting, the default server will be used (as
mentioned above), and the instantiation of the object will not be
affected by the <xref linkend="ini.com.allow-dcom"/>
directive.
<table>
<title>DCOM server name</title>
<tgroup cols="3">
<thead>
<row>
<entry><parameter>server_name</parameter> key</entry>
<entry>type</entry>
<entry>description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Server</entry>
<entry>string</entry>
<entry>The name of the server.</entry>
</row>
<row>
<entry>Username</entry>
<entry>string</entry>
<entry>The username to connect as.</entry>
</row>
<row>
<entry>Password</entry>
<entry>string</entry>
<entry>The password for <parameter>Username</parameter>.</entry>
</row>
<row>
<entry>Flags</entry>
<entry>integer</entry>
<entry>One or more of the following constants, logically OR'd together:
<constant>CLSCTX_INPROC_SERVER</constant>,
<constant>CLSCTX_INPROC_HANDLER</constant>,
<constant>CLSCTX_LOCAL_SERVER</constant>,
<constant>CLSCTX_REMOTE_SERVER</constant>,
<constant>CLSCTX_SERVER</constant> and
<constant>CLSCTX_ALL</constant>. The default value if not
specified here is <constant>CLSCTX_SERVER</constant> if you also
omit <parameter>Server</parameter>, or
<constant>CLSCTX_REMOTE_SERVER</constant> if you do specify a
server. You should consult the Microsoft documentation for
CoCreateInstance for more information on the meaning of these
constants; you will typically never have to use them.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
<varlistentry><term>codepage</term>
<listitem>
<simpara>
specifies the codepage that is used to convert php-strings to
unicode-strings and vice versa. Possible values are
<constant>CP_ACP</constant>, <constant>CP_MACCP</constant>,
Specifies the codepage that is used to convert strings to
unicode-strings and vice versa. The conversion is applied whenever a
PHP string is passed as a parameter or returned from a method of this
COM object. The code page is sticky in PHP 5, which means that it will
propogate to objects and variants returned from the object.
</simpara>
<simpara>
Possible values are
<constant>CP_ACP</constant> (use system default ANSI code page - the
default if this parameter is omitted),
<constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>, <constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>, <constant>CP_UTF7</constant>
and <constant>CP_UTF8</constant>.
<constant>CP_THREAD_ACP</constant> (use codepage/locale set for the
current executing thread), <constant>CP_UTF7</constant>
and <constant>CP_UTF8</constant>. You may also use the number for a
given codepage; consult the Microsoft documentation for more details on
codepages and their numeric values.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 id="class.com.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.
</para>
<para>
Starting with PHP 5, PHP will automatically detect methods that accept
parameters by reference, and will automatically convert regular PHP
variables to a form that can be passed by reference. This means that you
can call the method very naturally; you needn't go to any extra effort in
your code.
</para>
<para>
In PHP 4, to pass parameters by reference you need to create an instance
of the <xref linkend="class.variant"/> class to wrap the
byref parameters.
</para>
</refsect1>
<refsect1 id="class.com.falsemethods">
<title>Psuedo Methods</title>
<para>
In PHP versions prior to 5, a number of not very pleasant hacks meant that
the following method names were not passed through to COM and were handled
directly by PHP. PHP 5 eliminates these things; read the details below to
determine how to fix your scripts. These magic method names are case
insensitive.
</para>
<methodsynopsis>
<type>void</type><methodname>COM::AddRef</methodname>
<void/>
</methodsynopsis>
<simpara>Artificially adds a reference count to the COM object.</simpara>
<warning><simpara>You should never need to use this method. It exists a
logical complement to the Release() method below.</simpara></warning>
<methodsynopsis>
<type>void</type><methodname>COM::Release</methodname>
<void/>
</methodsynopsis>
<simpara>Artificially removes a reference count from the COM object.</simpara>
<warning><simpara>
You should never need to use this method. It's existence in PHP is a bug
designed to work around a bug that keeps COM objects running longer than
they should.
</simpara></warning>
</refsect1>
<refsect1 id="class.com.iteratormethods">
<title>Psuedo Methods for Iterating</title>
<para>
These pseudo methods are only available if
<function>com_isenum</function> returns &true;, in which case, they hide
any methods with the same names that might otherwise be provided by the
COM object. These methods have all been eliminated in PHP 5, and you
should use <xref linkend="com.foreach"/> instead.
</para>
<methodsynopsis>
<type>object</type><methodname>COM::All</methodname>
<void/>
</methodsynopsis>
<simpara>Returns a variant representing a SafeArray that has 10 elements;
each element will be an empty/null variant. This function was supposed to
return an array containing all the elements from the iterator, but was
never completed. Do not use.
</simpara>
<methodsynopsis>
<type>object</type><methodname>COM::Next</methodname>
<void/>
</methodsynopsis>
<simpara>Returns a variant representing the next element available from
the iterator, or &false; when there are no more elements.
</simpara>
<methodsynopsis>
<type>object</type><methodname>COM::Prev</methodname>
<void/>
</methodsynopsis>
<simpara>Returns a variant representing the previous element available from
the iterator, or &false; when there are no more elements.
</simpara>
<methodsynopsis>
<type>void</type><methodname>COM::Reset</methodname>
<void/>
</methodsynopsis>
<simpara>Rewinds the iterator back to the start.</simpara>
</refsect1>
<refsect1 id="class.com.examples">
<title>COM examples</title>
<para>
<example id="example.com1">
<title>COM example (1)</title>
@ -65,7 +260,7 @@
<![CDATA[
<?php
// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
$word = new COM("word.application") or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";
//bring it to front
@ -82,7 +277,6 @@ $word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit();
//free the object
$word->Release();
$word = null;
?>
]]>
@ -122,9 +316,6 @@ while (!$rs->EOF) {
$rs->Close();
$conn->Close();
$rs->Release();
$conn->Release();
$rs = null;
$conn = null;

View file

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="class.dotnet">
<refnamediv>
<refname>DOTNET</refname>
<refpurpose>DOTNET class</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>$obj = new <classname>DOTNET</classname>("assembly", "classname")</synopsis>
</refsynopsisdiv>
<refsect1 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>
</refsect1>
<refsect1 id="class.dotnet.constructor">
<title>Methods</title>
<methodsynopsis>
<type>string</type><methodname>DOTNET::DOTNET</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 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>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="class.variant">
<refnamediv>
@ -12,7 +12,10 @@
<refsect1 id="class.variant.class">
<title>Description</title>
<simpara>
A simple container to wrap variables into VARIANT structures.
The VARIANT is COM's equivalent of the PHP zval; it is a structure that
can contain a value with a range of different possible types. The VARIANT
class provided by the COM extension allows you to have more control over
the way that PHP passes values to and from COM.
</simpara>
</refsect1>
<refsect1 id="class.variant.constructor">
@ -29,7 +32,7 @@
<varlistentry><term>value</term>
<listitem>
<simpara>
initial value. if omitted an VT_EMPTY object is created.
initial value. if omitted, or set to &null; an VT_EMPTY object is created.
</simpara>
</listitem>
</varlistentry>
@ -37,31 +40,99 @@
<listitem>
<simpara>
specifies the content type of the VARIANT object. Possible values are
<constant>VT_UI1</constant>, <constant>VT_UI2</constant>, <constant>VT_UI4</constant>,
<constant>VT_I1</constant>, <constant>VT_I2</constant>, <constant>VT_I4</constant>,
<constant>VT_R4</constant>, <constant>VT_R8</constant>, <constant>VT_INT</constant>, <constant>VT_UINT</constant>,
<constant>VT_BOOL</constant>, <constant>VT_ERROR</constant>, <constant>VT_CY</constant>,
<constant>VT_DATE</constant>, <constant>VT_BSTR</constant>, <constant>VT_DECIMAL</constant>,
<constant>VT_UNKNOWN</constant>, <constant>VT_DISPATCH</constant> and <constant>VT_VARIANT</constant>. These values are
mutual exclusive, but they can be combined with <constant>VT_BYREF</constant> to specify being a value. If omitted,
the type of <parameter>value</parameter> is used. Consult the <acronym>MSDN</acronym> library for additional information.
one of the <constant>VT_XXX</constant> <xref
linkend="com.constants"/>.
</simpara>
<simpara>
In PHP versions prior to PHP 5, you could force PHP to pass a variant
object by reference by OR'ing <constant>VT_BYREF</constant>
with the <parameter>type</parameter>. In PHP 5, this hack is not
supported; instead, PHP 5 can detect parameters passed by reference
automatically; they do not even need to be passed as VARIANT objects.
</simpara>
<simpara>
Consult the <acronym>MSDN</acronym> library for additional information
on the VARIANT type.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term>codepage</term>
<listitem>
<simpara>
specifies the codepage that is used to convert php-strings to
unicode-strings and vice versa. Possible values are
<constant>CP_ACP</constant>, <constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>, <constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>, <constant>CP_UTF7</constant>
and <constant>CP_UTF8</constant>.
specifies the codepage that is used to convert strings to
unicode. See the parameter of the same name in the
<xref linkend="class.com"/> class for more information.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
PHP versions prior to PHP 5 define a number of (undocumented) virtual properties
for instances of the VARIANT class; these properties have all been removed in
PHP 5 in favour of its more natural syntax; these differences are best
highlighted by example:
</para>
<para>
<example id="com.variant.example.php4">
<title>Variant example, PHP 4.x style</title>
<programlisting role="php">
<![CDATA[
<?php
$v = new VARIANT(42);
print "The type is " . $v->type . "<br/>";
print "The value is " . $v->value . "<br/>";
?>
]]>
</programlisting>
</example>
</para>
<para>
<example id="com.variant.example.php5">
<title>Variant example, PHP 5 style</title>
<programlisting role="php">
<![CDATA[
<?php
$v = new VARIANT(42);
print "The type is " . variant_get_type($v) . "<br/>";
print "The value is " . $v . "<br/>";
?>
]]>
</programlisting>
</example>
</para>
<para>
The reason for the change is that, internally, the COM extension sees
VARIANT, COM and DOTNET classes as the same thing, and the design
philosophy for these classes is that all property and member accesses are
passed through to COM with no interference. The new syntax is more
natural and less effort, and most of the removed virtual properties didn't
make any sense in a PHP context in any case.
</para>
<note>
<para>
PHP 5 takes a much simpler approach to handling VARIANTs; when returning
a value or fetching a variant property, the variant is converted to a PHP
value only when there is a direct mapping between the types that would
not result in a loss of information. In all other cases, the result is
returned as an instance of the VARIANT class. You can force PHP to
convert or evaluate the variant as a PHP native type by using a casting
operator explicitly, or implicitly casting to a string by
<function>print</function>ing it. You may use the wide range of variant
functions to perform arithmetic operations on variants without forcing a
conversion or risking a loss of data.
</para>
</note>
<para>
See also <function>variant_get_type</function>.
</para>
</refsect1>
</refentry>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-addref">
<refnamediv>
<refname>com_addref</refname>
<refpurpose>
Increases the components reference counter.
Increases the components reference counter [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
@ -17,6 +17,16 @@
<para>
Increases the components reference counter.
</para>
<warning>
<simpara>
You should never need to use this function.
</simpara>
</warning>
<note>
<simpara>This function has gone away in PHP 5.</simpara>
</note>
</refsect1>
</refentry>

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.com-create-guid">
<refnamediv>
<refname>com_create_guid</refname>
<refpurpose>
Generate a globally unique identifier (GUID)
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>com_create_guid</methodname>
<void/>
</methodsynopsis>
<para>
Generates a Globally Unique Identifier (GUID) and returns it as a string.
A GUID is generated in the same way as DCE UUID's, except that the
Microsoft convention is to enclose a GUID in curly braces.
</para>
<para>
See also <function>uuid_create</function> in the PECL uuid extension.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,107 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.com-event-sink">
<refnamediv>
<refname>com_event_sink</refname>
<refpurpose>
Connect events from a COM object to a PHP object
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>com_event_sink</methodname>
<methodparam><type>object</type><parameter>comobject</parameter></methodparam>
<methodparam><type>object</type><parameter>sinkobject</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>sinkinterface</parameter></methodparam>
</methodsynopsis>
<para>
Instructs COM to sink events generated by
<parameter>comobject</parameter> into the PHP object
<parameter>sinkobject</parameter>. PHP will attempt to use the default
dispinterface type specified by the typelibrary associated with
<parameter>comobject</parameter>, but you may override this choice by
setting <parameter>sinkinterface</parameter> to the name of the
dispinterface that you want to use.
</para>
<para>
<parameter>sinkobject</parameter> should be an instance of a class with
methods named after those of the desired dispinterface; you may use
<function>com_print_typeinfo</function> to help generate a template class
for this purpose.
</para>
<para>
Be careful how you use this feature; if you are doing something similar
to the example below, then it doesn't really make sense to run it in a
web server context.
</para>
<example>
<title>COM event sink example</title>
<programlisting role="php">
<![CDATA[
<?php
class IEEventSinker {
var $terminated = false;
function ProgressChange($progress, $progressmax) {
echo "Download progress: $progress / $progressmax\n";
}
function DocumentComplete(&$dom, $url) {
echo "Document $url complete\n";
}
function OnQuit() {
echo "Quit!\n";
$this->terminated = true;
}
}
$ie = new COM("InternetExplorer.Application");
// note that you don't need the & for PHP 5!
$sink =& new IEEventSinker();
com_event_sink($ie, $sink, "DWebBrowserEvents2");
$ie->Visible = true;
$ie->Navigate("http://www.php.net");
while(!$sink->terminated) {
com_message_pump(4000);
}
$ie = null;
?>
]]>
</programlisting>
</example>
<para>
See also <function>com_print_typeinfo</function>,
<function>com_message_pump</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-get">
<refnamediv>
<refname>com_get</refname>
<refpurpose>
Gets the value of a COM Component's property
Gets the value of a COM Component's property [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
@ -20,6 +20,24 @@
COM component referenced by <parameter>com_object</parameter>.
Returns &false; on error.
</para>
<para>
<example>
<title>Don't use com_get(), use OO syntax instead</title>
<programlisting role="php">
<![CDATA[
<?php
// do this
$var = $obj->property;
// instead of this:
$var = com_get($obj, 'property');
?>
]]>
</programlisting>
</example>
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-invoke">
<refnamediv>
<refname>com_invoke</refname>
<refpurpose>
Calls a COM component's method.
Calls a COM component's method [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
@ -26,6 +26,23 @@
<parameter>function_parameters</parameter> are passed to
the method <parameter>function_name</parameter>.
</para>
<para>
<example>
<title>Don't use com_invoke(), use OO syntax instead</title>
<programlisting role="php">
<![CDATA[
<?php
// do this
$val = $obj->method($one, $two);
// instead of this:
$val = com_invoke($obj, 'method', $one, $two);
?>
]]>
</programlisting>
</example>
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -1,20 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.27 -->
<refentry id='function.com-isenum'>
<refnamediv>
<refname>com_isenum</refname>
<refpurpose>Grabs an IEnumVariant</refpurpose>
<refpurpose>Indicates if a COM object has an IEnumVariant interface for iteration [deprecated]</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>com_isenum</methodname>
<type>boolean</type><methodname>com_isenum</methodname>
<methodparam><type>object</type><parameter>com_module</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
Checks to see if a COM object can be enumerated using the
<literal>Next()</literal> method hack. Returns &true; if it can, &false; if it cannot.
See <xref linkend="class.com"/> class for more details on these
methods.
</para>
<note>
<para>
This function does not exist in PHP 5; use the more natural
<xref linkend="control-structures.foreach"/> statement to iterate
over the contents of COM objects. See <xref linkend="com.foreach"/> for
more details.
</para>
</note>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.27 -->
<refentry id='function.com-load-typelib'>
<refnamediv>
@ -9,13 +9,61 @@
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>com_load_typelib</methodname>
<type>bool</type><methodname>com_load_typelib</methodname>
<methodparam><type>string</type><parameter>typelib_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>case_insensitive</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
Loads a type-library and registers its constants in the engine, as though
they were defined using <function>define</function>. The
<parameter>case_insensitive</parameter> behaves in the same way as the
parameter with the same name in the <function>define</function> function.
</para>
<para>
<parameter>typelib_name</parameter> can be one of the following:
<itemizedlist>
<listitem>
<para>
The filename of a <literal>.tlb</literal> file or the executable module
that contains the type library.
</para>
</listitem>
<listitem>
<para>
The type library GUID, followed by its version number, for example
<literal>{00000200-0000-0010-8000-00AA006D2EA4},2,0</literal>.
</para>
</listitem>
<listitem>
<para>
The type library name, e.g. <literal>Microsoft OLE DB ActiveX Data
Objects 1.0 Library</literal>.
</para>
</listitem>
</itemizedlist>
PHP will attempt to resolve the type library in this order, as the
process gets more and more expensive as you progress down the list;
searching for the type library by name is handled by physically
enumerating the registry until we find a match.
</para>
<para>
Note that it is much more efficient to use the
<xref linkend="ini.com.typelib-file"/>
configuration setting to pre-load and register the constants,
although not so flexible.
</para>
<para>
If you have turned on <xref
linkend="ini.com.autoregister-typelib"/>,
then PHP will attempt to automatically register the constants associated
with a COM object when you instantiate it. This depends on the
interfaces provided by the COM object itself, and may not always be
possible.
</para>
</refsect1>
</refentry>

View file

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-load">
<refnamediv>
<refname>com_load</refname>
<refpurpose>
Creates a new reference to a COM component
Creates a new reference to a COM component [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>com_load</methodname>
<type>resource</type><methodname>com_load</methodname>
<methodparam><type>string</type><parameter>module_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
server_name
@ -21,17 +21,33 @@
</parameter></methodparam>
</methodsynopsis>
<para>
<function>com_load</function> creates a new COM component and
returns a reference to it. Returns &false; on failure. Possible
values for <parameter>codepage</parameter> are:
<constant>CP_ACP</constant>,
<constant>CP_MACCP</constant>,
<constant>CP_OEMCP</constant>,
<constant>CP_SYMBOL</constant>,
<constant>CP_THREAD_ACP</constant>,
<constant>CP_UTF7</constant>, and
<constant>CP_UTF8</constant>.
Equivalent to using the <literal>new</literal> operator to create an
instance of the <xref linkend="class.com"/> class. You should do
that instead of calling this function.
</para>
<para>
<example>
<title>Don't use com_load(), use OO syntax instead</title>
<programlisting role="php">
<![CDATA[
<?php
// do this
$obj = new COM($module);
// instead of this:
$obj = com_load($module);
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
This function does not exist in PHP 5; use the <xref
linkend="class.com"/> class instead.
</para>
</note>
</refsect1>
</refentry>

View file

@ -0,0 +1,61 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.com-message-pump">
<refnamediv>
<refname>com_message_pump</refname>
<refpurpose>
Process COM messages, sleeping for up to timeoutms milliseconds
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>com_message_pump</methodname>
<methodparam choice="opt"><type>int</type><parameter>timeoutms</parameter></methodparam>
</methodsynopsis>
<para>
This function will sleep for up to <parameter>timeoutms</parameter>
milliseconds, or until a message arrives in the queue. If a message or
messages arrives before the timeout, they will be dispatched, and the
function will return &true;. If the timeout occurs and no messages were
processed, the return value will be &false;. If you do not specify a
value for <parameter>timeoutms</parameter>, then 0 will be assumed. A 0
value means that no waiting will be performed; if there are messages
pending they will be dispatched as before; if there are no messages
pending, the function will return &false; immediately without sleeping.
</para>
<para>
The purpose of this function is to route COM calls between apartments and
handle various synchronization issues. This allows your script to wait
efficiently for events to be triggered, while still handling other events
or running other code in the background. You should use it in a loop, as
demonstrated by the example in the <function>com_event_sink</function>
function, until you are finished using event bound COM objects.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,66 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.com-print-typeinfo">
<refnamediv>
<refname>com_print_typeinfo</refname>
<refpurpose>
Print out a PHP class definition for a dispatchable interface
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>com_print_typeinfo</methodname>
<methodparam><type>object</type><parameter>comobject</parameter></methodparam>
<methodparam><type>string</type><parameter>dispinterface</parameter></methodparam>
<methodparam><type>bool</type><parameter>wantsink</parameter></methodparam>
</methodsynopsis>
<para>
The purpose of this function is to help generate a skeleton class for use
as an event sink. You may also use it to generate a dump of any COM
object, provided that it supports enough of the introspection
interfaces, and that you know the name of the interface you want to
display.
</para>
<para>
<parameter>comobject</parameter> should be either an instance of a COM
object, or be the name of a typelibrary (which will be resolved according
to the rules set out in <function>com_load_typelib</function>).
<parameter>dispinterface</parameter> is the name of an IDispatch
descendant interface that you want to display. If
<parameter>wantsink</parameter> is &true;, the corresponding sink
interface will be displayed instead.
</para>
<para>
See also <function>com_event_sink</function>,
<function>com_load_typelib</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-propget">
<refnamediv>
@ -11,6 +11,7 @@
<para>
This function is an alias for <function>com_get</function>.
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-propput">
<refnamediv>
@ -11,6 +11,7 @@
<para>
This function is an alias for <function>com_set</function>.
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-propset">
<refnamediv>
@ -11,6 +11,7 @@
<para>
This function is an alias for <function>com_set</function>.
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-release">
<refnamediv>
<refname>com_release</refname>
<refpurpose>
Decreases the components reference counter.
Decreases the components reference counter [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
@ -17,6 +17,18 @@
<para>
Decreases the components reference counter.
</para>
<warning>
<simpara>
You should never need to use this function.
</simpara>
</warning>
<note>
<simpara>This function has gone away in PHP 5.</simpara>
</note>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/com.xml, last change in rev 1.7 -->
<refentry id="function.com-set">
<refnamediv>
@ -21,6 +21,25 @@
component referenced by <parameter>com_object</parameter>.
Returns the newly set value if succeeded, &false; on error.
</para>
<para>
<example>
<title>Don't use com_set(), use OO syntax instead</title>
<programlisting role="php">
<![CDATA[
<?php
// do this
$obj->property = $value;
// instead of this:
com_set($obj, 'property', $value);
?>
]]>
</programlisting>
</example>
</para>
&reference.com.use-oo-instead;
</refsect1>
</refentry>

View file

@ -0,0 +1,49 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.variant-abs">
<refnamediv>
<refname>variant_abs</refname>
<refpurpose>
Returns the absolute value of a variant
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_abs</methodname>
<methodparam><type>mixed</type><parameter>val</parameter></methodparam>
</methodsynopsis>
<para>
Returns the absolute value of <parameter>val</parameter>.
</para>
<para>
See also <function>abs</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-add">
<refnamediv>
<refname>variant_add</refname>
<refpurpose>
"Adds" two variant values together and returns the result
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_add</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Adds <parameter>left</parameter> to <parameter>right</parameter> using
the following rules (taken from the MSDN library), which correspond to
those of Visual Basic:
<table>
<title>Variant Addition Rules</title>
<tgroup cols="2">
<thead>
<row>
<entry>If</entry>
<entry>Then</entry>
</row>
</thead>
<tbody>
<row>
<entry>Both expressions are of the string type</entry>
<entry>Concatenation</entry>
</row>
<row>
<entry>One expression is a string type and the other a
character</entry>
<entry>Addition</entry>
</row>
<row>
<entry>One expression is numeric and the other is a string</entry>
<entry>Addition</entry>
</row>
<row>
<entry>Both expressions are numeric</entry>
<entry>Addition</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
<entry>Integer subtype is returned</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_sub</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,74 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-and">
<refnamediv>
<refname>variant_and</refname>
<refpurpose>
performs a bitwise AND operation between two variants and returns the result
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_and</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Performs a bitwise AND operation, according to the following truth table;
note that this is slightly different from a regular AND operation.
<table>
<title>Variant AND Rules</title>
<tgroup cols="3">
<thead>
<row>
<entry>If <parameter>left</parameter> is</entry>
<entry>If <parameter>right</parameter> is</entry>
<entry>then the result is</entry>
</row>
</thead>
<tbody>
<row><entry>&true;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&true;</entry><entry>&false;</entry><entry>&false;</entry></row>
<row><entry>&true;</entry><entry>&null;</entry><entry>&null;</entry></row>
<row><entry>&false;</entry><entry>&true;</entry><entry>&false;</entry></row>
<row><entry>&false;</entry><entry>&false;</entry><entry>&false;</entry></row>
<row><entry>&false;</entry><entry>&null;</entry><entry>&false;</entry></row>
<row><entry>&null;</entry><entry>&true;</entry><entry>&null;</entry></row>
<row><entry>&null;</entry><entry>&false;</entry><entry>&false;</entry></row>
<row><entry>&null;</entry><entry>&null;</entry><entry>&null;</entry></row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_or</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,57 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-cast">
<refnamediv>
<refname>variant_cast</refname>
<refpurpose>
Convert a variant into a new variant object of another type
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>object</type><methodname>variant_cast</methodname>
<methodparam><type>object</type><parameter>variant</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function makes a copy of <parameter>variant</parameter> and then
performs a variant cast operation to force the copy to have the type
given by <parameter>type</parameter>. <parameter>type</parameter> should
be one of the <constant>VT_XXX</constant> constants.
</para>
<para>
This function wraps VariantChangeType() in the COM library; consult MSDN
for more information.
</para>
<para>
See also <function>variant_set_type</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-cat">
<refnamediv>
<refname>variant_cat</refname>
<refpurpose>
concatenates two variant values together and returns the result
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_cat</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Concatenates <parameter>left</parameter> with
<parameter>right</parameter> and returns the result.
</para>
<para>
See also <xref linkend="language.operators.string"/> for the string
concatenation operator; this function is notionally equivalent to
<parameter>$left</parameter> <literal>.</literal> <parameter>$right</parameter>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,145 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-cmp">
<refnamediv>
<refname>variant_cmp</refname>
<refpurpose>
Compares two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>variant_cmp</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>lcid</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
</methodsynopsis>
<para>
Compares <parameter>left</parameter> with <parameter>right</parameter>
and returns one of the following values:
<table>
<title>Variant Comparision Results</title>
<tgroup cols="2">
<thead>
<row>
<entry>value</entry>
<entry>meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>VARCMP_LT</constant></entry>
<entry><parameter>left</parameter> is less than
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_EQ</constant></entry>
<entry><parameter>left</parameter> is equal to
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_GT</constant></entry>
<entry><parameter>left</parameter> is greater than
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_NULL</constant></entry>
<entry>Either <parameter>left</parameter>,
<parameter>right</parameter> or both are &null;
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
This function will only compare scalar values, not arrays or variant records.
</para>
<para>
<parameter>lcid</parameter> is a valid Locale Identifier to use when
comparing strings (this affects string collation).
<parameter>flags</parameter> can be one or more of the following values
OR'd together, and affects string comparisons:
<table>
<title>Variant Comparision Flags</title>
<tgroup cols="2">
<thead>
<row>
<entry>value</entry>
<entry>meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>NORM_IGNORECASE</constant></entry>
<entry>Compare case insensitively</entry>
</row>
<row>
<entry><constant>NORM_IGNORENONSPACE</constant></entry>
<entry>Ignore nonspacing characters</entry>
</row>
<row>
<entry><constant>NORM_IGNORESYMBOLS</constant></entry>
<entry>Ignore symbols</entry>
</row>
<row>
<entry><constant>NORM_IGNOREWIDTH</constant></entry>
<entry>Ignore string width</entry>
</row>
<row>
<entry><constant>NORM_IGNOREKANATYPE</constant></entry>
<entry>Ignore Kana type</entry>
</row>
<row>
<entry><constant>NORM_IGNOREKASHIDA</constant></entry>
<entry>Ignore Arabic kashida characters</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,52 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-date-from-timestamp">
<refnamediv>
<refname>variant_date_from_timestamp</refname>
<refpurpose>
Returns a variant date representation of a unix timestamp
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>object</type><methodname>variant_date_from_timestamp</methodname>
<methodparam><type>int</type><parameter>timestamp</parameter></methodparam>
</methodsynopsis>
<para>
Converts <parameter>timestamp</parameter> from a unix timestamp value
into a variant of type <constant>VT_DATE</constant>. This allows easier
interopability between the unix-ish parts of PHP and COM.
</para>
<para>
See also <function>variant_date_to_timestamp</function> for the inverse
of this operation,
<function>mktime</function>, <function>time</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,52 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-date-to-timestamp">
<refnamediv>
<refname>variant_date_to_timestamp</refname>
<refpurpose>
Converts a variant date/time value to unix timestamp
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>variant_date_to_timestamp</methodname>
<methodparam><type>object</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
Converts <parameter>variant</parameter> from a <constant>VT_DATE</constant>
(or similar) value into a unix timestamp. This allows easier
interopability between the unix-ish parts of PHP and COM.
</para>
<para>
See also <function>variant_date_from_timestamp</function> for the inverse
of this operation,
<function>date</function>, <function>strftime</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,99 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-div">
<refnamediv>
<refname>variant_div</refname>
<refpurpose>
Returns the result from dividing two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_div</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Divides <parameter>left</parameter> by <parameter>right</parameter> and
returns the result, subject to the following rules:
<table>
<title>Variant Division Rules</title>
<tgroup cols="2">
<thead>
<row>
<entry>If</entry>
<entry>Then</entry>
</row>
</thead>
<tbody>
<row>
<entry>Both expressions are of the string, date, character, boolean type</entry>
<entry>Double is returned</entry>
</row>
<row>
<entry>One expression is a string type and the other a
character</entry>
<entry>Division and a double is returned</entry>
</row>
<row>
<entry>One expression is numeric and the other is a string</entry>
<entry>Division and a double is returned.</entry>
</row>
<row>
<entry>Both expressions are numeric</entry>
<entry>Division and a double is returned</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
</row>
<row>
<entry><parameter>right</parameter> is empty and
<parameter>left</parameter> is anything but empty</entry>
<entry>A com_exception with code <constant>DISP_E_DIVBYZERO</constant>
is thrown</entry>
</row>
<row>
<entry><parameter>left</parameter> is empty and
<parameter>right</parameter> is anything but empty.</entry>
<entry>0 as type double is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
<entry>A com_exception with code <constant>DISP_E_OVERFLOW</constant>
is thrown</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,48 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-eqv">
<refnamediv>
<refname>variant_eqv</refname>
<refpurpose>
Performs a bitwise equivalence on two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_eqv</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
If each bit in <parameter>left</parameter> is equal to the corresponding
bit in <parameter>right</parameter> then &true; is returned, otherwise
&false; is returned.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,64 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-fix">
<refnamediv>
<refname>variant_fix</refname>
<refpurpose>
Returns the integer portion ? of a variant
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_fix</methodname>
<methodparam><type>mixed</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
If <parameter>variant</parameter> is negative, then the first negative
integer greater than or equal to the variant is returned, otherwise
returns the integer portion of the value of
<parameter>variant</parameter>.
</para>
<para>
See also <function>variant_int</function>,
<function>variant_round</function>, <function>floor</function>,
<function>ceil</function>,
<function>round</function>.
</para>
<warning>
<simpara>
This documentation is based on the MSDN documentation; it appears
that this function is either the same as
<function>variant_int</function>, or that there is an error in the MSDN
documentation.
</simpara>
</warning>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.variant-get-type">
<refnamediv>
<refname>variant_get_type</refname>
<refpurpose>Returns the type of a variant object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>variant_get_type</methodname>
<methodparam><type>object</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an integer value that indicates the type of
<parameter>variant</parameter>, which can be an instance of
<xref linkend="class.com"/>,
<xref linkend="class.dotnet"/> or
<xref linkend="class.variant"/> classes. The return value
can be compared to one of the <constant>VT_XXX</constant> constants.
</para>
<para>
The return value for COM and DOTNET objects will usually be
<constant>VT_DISPATCH</constant>; the only reason this function works for
those classes is because COM and DOTNET are descendants of VARIANT.
</para>
<para>
In PHP versions prior to 5, you could obtain this information from
instances of the VARIANT class ONLY, by reading a fake
<parameter>type</parameter> property. See the <xref
linkend="class.variant"/> class for more information on
this.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,91 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-idiv">
<refnamediv>
<refname>variant_idiv</refname>
<refpurpose>
Converts variants to integers and then returns the result from dividing them
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_idiv</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Converts <parameter>left</parameter> and <parameter>right</parameter> to
integer values, and then performs integer division according the
following rules:
<table>
<title>Variant Integer Division Rules</title>
<tgroup cols="2">
<thead>
<row>
<entry>If</entry>
<entry>Then</entry>
</row>
</thead>
<tbody>
<row>
<entry>Both expressions are of the string, date, character, boolean type</entry>
<entry>Division and integer is returned</entry>
</row>
<row>
<entry>One expression is a string type and the other a
character</entry>
<entry>Division</entry>
</row>
<row>
<entry>One expression is numeric and the other is a string</entry>
<entry>Division</entry>
</row>
<row>
<entry>Both expressions are numeric</entry>
<entry>Division</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
<entry>A com_exception with code <constant>DISP_E_DIVBYZERO</constant>
is thrown</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_div</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,69 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-imp">
<refnamediv>
<refname>variant_imp</refname>
<refpurpose>
Performs a bitwise implication on two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_imp</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Performs a bitwise implication operation, according to the following truth table:
<table>
<title>Variant Implication Table</title>
<tgroup cols="3">
<thead>
<row>
<entry>If <parameter>left</parameter> is</entry>
<entry>If <parameter>right</parameter> is</entry>
<entry>then the result is</entry>
</row>
</thead>
<tbody>
<row><entry>&true;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&true;</entry><entry>&false;</entry><entry>&true;</entry></row>
<row><entry>&true;</entry><entry>&null;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&false;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&null;</entry><entry>&true;</entry></row>
<row><entry>&null;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&null;</entry><entry>&false;</entry><entry>&null;</entry></row>
<row><entry>&null;</entry><entry>&null;</entry><entry>&null;</entry></row>
</tbody>
</tgroup>
</table>
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,56 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-int">
<refnamediv>
<refname>variant_int</refname>
<refpurpose>
Returns the integer portion of a variant
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_int</methodname>
<methodparam><type>mixed</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
If <parameter>variant</parameter> is negative, then the first negative
integer greater than or equal to the variant is returned, otherwise
returns the integer portion of the value of
<parameter>variant</parameter>.
</para>
<para>
See also <function>variant_fix</function>,
<function>variant_round</function>, <function>floor</function>,
<function>ceil</function>,
<function>round</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,52 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-mod">
<refnamediv>
<refname>variant_mod</refname>
<refpurpose>
Divides two variants and returns only the remainder
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_mod</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Divides <parameter>left</parameter> by <parameter>right</parameter> and
returns the remainder.
</para>
<para>
See also <function>variant_div</function>,
<function>variant_idiv</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,95 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-mul">
<refnamediv>
<refname>variant_mul</refname>
<refpurpose>
multiplies the values of the two variants and returns the result
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_mul</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Multiplies <parameter>left</parameter> by <parameter>right</parameter> and
returns the result, subject to the following rules:
<table>
<title>Variant Multiplication Rules</title>
<tgroup cols="2">
<thead>
<row>
<entry>If</entry>
<entry>Then</entry>
</row>
</thead>
<tbody>
<row>
<entry>Both expressions are of the string, date, character, boolean type</entry>
<entry>Multiplication</entry>
</row>
<row>
<entry>One expression is a string type and the other a
character</entry>
<entry>Multiplication</entry>
</row>
<row>
<entry>One expression is numeric and the other is a string</entry>
<entry>Multiplication</entry>
</row>
<row>
<entry>Both expressions are numeric</entry>
<entry>Multiplication</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
<entry>Empty string is returned</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
Boolean values are converted to -1 for &false; and 0 for &true;.
</para>
<para>
See also <function>variant_div</function>,
<function>variant_idiv</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,46 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-neg">
<refnamediv>
<refname>variant_neg</refname>
<refpurpose>
Performs logical negation on a variant
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_neg</methodname>
<methodparam><type>mixed</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
Performs logical negation of <parameter>variant</parameter> and returns
the result.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,47 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-not">
<refnamediv>
<refname>variant_not</refname>
<refpurpose>
Performs bitwise not negation on a variant
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_not</methodname>
<methodparam><type>mixed</type><parameter>variant</parameter></methodparam>
</methodsynopsis>
<para>
Performs bitwise not negation on <parameter>variant</parameter> and
returns the result. If <parameter>variant</parameter> is &null;, the
result will also be &null;.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,72 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-or">
<refnamediv>
<refname>variant_or</refname>
<refpurpose>
Performs a logical disjunction on two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_or</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Performs a bitwise OR operation, according to the following truth table;
note that this is slightly different from a regular OR operation.
<table>
<title>Variant OR Rules</title>
<tgroup cols="3">
<thead>
<row>
<entry>If <parameter>left</parameter> is</entry>
<entry>If <parameter>right</parameter> is</entry>
<entry>then the result is</entry>
</row>
</thead>
<tbody>
<row><entry>&true;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&true;</entry><entry>&false;</entry><entry>&true;</entry></row>
<row><entry>&true;</entry><entry>&null;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&false;</entry><entry>&false;</entry></row>
<row><entry>&false;</entry><entry>&null;</entry><entry>&null;</entry></row>
<row><entry>&null;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&null;</entry><entry>&false;</entry><entry>&null;</entry></row>
<row><entry>&null;</entry><entry>&null;</entry><entry>&null;</entry></row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_and</function>,
<function>variant_xor</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,51 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-pow">
<refnamediv>
<refname>variant_pow</refname>
<refpurpose>
Returns the result of performing the power function with two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_pow</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Returns the result of <parameter>left</parameter> to the power of
<parameter>right</parameter>.
</para>
<para>
See also <function>pow</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,51 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-round">
<refnamediv>
<refname>variant_round</refname>
<refpurpose>
Rounds a variant to the specified number of decimal places
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_round</methodname>
<methodparam><type>mixed</type><parameter>variant</parameter></methodparam>
<methodparam><type>int</type><parameter>decimals</parameter></methodparam>
</methodsynopsis>
<para>
Returns the value of <parameter>variant</parameter> rounded to
<parameter>decimals</parameter> decimal places.
</para>
<para>
See also <function>round</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,52 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-set-type">
<refnamediv>
<refname>variant_set_type</refname>
<refpurpose>
Convert a variant into another type. Variant is modified "in-place"
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>variant_set_type</methodname>
<methodparam><type>object</type><parameter>variant</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function is similar to <function>variant_cast</function> except that
the variant is modified "in-place"; no new variant is created. The
parameters for this function have identical meaning to those of
<function>variant_cast</function>.
</para>
<para>
See also <function>variant_cast</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,47 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-set">
<refnamediv>
<refname>variant_set</refname>
<refpurpose>
Assigns a new value for a variant object
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>variant_set</methodname>
<methodparam><type>object</type><parameter>variant</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Converts <parameter>value</parameter> to a variant and assigns it to the
<parameter>variant</parameter> object; no new variant object is created,
and the old value of <parameter>variant</parameter> is freed/released.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,90 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-sub">
<refnamediv>
<refname>variant_sub</refname>
<refpurpose>
subtracts the value of the right variant from the left variant value and returns the result
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_sub</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Subtracts <parameter>right</parameter> from <parameter>left</parameter> using
the following rules:
<table>
<title>Variant Subtraction Rules</title>
<tgroup cols="2">
<thead>
<row>
<entry>If</entry>
<entry>Then</entry>
</row>
</thead>
<tbody>
<row>
<entry>Both expressions are of the string type</entry>
<entry>Subtraction</entry>
</row>
<row>
<entry>One expression is a string type and the other a
character</entry>
<entry>Subtraction</entry>
</row>
<row>
<entry>One expression is numeric and the other is a string</entry>
<entry>Subtraction.</entry>
</row>
<row>
<entry>Both expressions are numeric</entry>
<entry>Subtraction</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
<entry>Empty string is returned</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_add</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -0,0 +1,69 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.variant-xor">
<refnamediv>
<refname>variant_xor</refname>
<refpurpose>
Performs a logical exclusion on two variants
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>variant_xor</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
</methodsynopsis>
<para>
Performs a logical exclusion, according to the following truth table:
<table>
<title>Variant XOR Rules</title>
<tgroup cols="3">
<thead>
<row>
<entry>If <parameter>left</parameter> is</entry>
<entry>If <parameter>right</parameter> is</entry>
<entry>then the result is</entry>
</row>
</thead>
<tbody>
<row><entry>&true;</entry><entry>&true;</entry><entry>&false;</entry></row>
<row><entry>&true;</entry><entry>&false;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&true;</entry><entry>&true;</entry></row>
<row><entry>&false;</entry><entry>&false;</entry><entry>&false;</entry></row>
<row><entry>&null;</entry><entry>&null;</entry><entry>&null;</entry></row>
</tbody>
</tgroup>
</table>
</para>
<para>
See also <function>variant_and</function>,
<function>variant_or</function>.
</para>
&reference.com.variant-arith;
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<section id="com.configuration">
&reftitle.runtime;
&extension.runtime;
@ -23,17 +23,22 @@
<row>
<entry>com.autoregister_typelib</entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>com.autoregister_verbose</entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>com.autoregister_casesensitive</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>com.code_page</entry>
<entry>""</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>com.typelib_file</entry>
@ -46,6 +51,117 @@
For further details and definition of the PHP_INI_* constants see
<function>ini_set</function>.
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry id="ini.com.allow-dcom">
<term>
<parameter>com.allow_dcom</parameter>
</term>
<listitem>
<para>
When this is turned on, PHP will be allowed to operate as a D-COM
(Distributed COM) client and will allow the PHP script to instantiate
COM objects on a remote server.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.com.autoregister-typelib">
<term>
<parameter>com.autoregister_typelib</parameter>
</term>
<listitem>
<para>
When this is turned on, PHP will attempt to register constants from
the typelibrary of objects that it instantiates, if those objects
implement the interfaces required to obtain that information.
The case sensitivity of the constants it registers is controlled by the
<xref
linkend="ini.com.autoregister-casesensitive"/> configuration directive.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.com.autoregister-verbose">
<term>
<parameter>com.autoregister_verbose</parameter>
</term>
<listitem>
<para>
When this is turned on, any problems with loading a typelibrary during
object instantiation will be reported using the PHP error mechanism.
The default is off, which does not emit any indication if there was
an error finding or loading the type library.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.com.autoregister-casesensitive">
<term>
<parameter>com.autoregister_casesensitive</parameter>
</term>
<listitem>
<para>
When this is turned on (the default), constants found in auto-loaded
type libraries will be registered case sensitively. See
<function>com_load_typelib</function> for more details.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.com.code-page">
<term>
<parameter>com.code_page</parameter>
</term>
<listitem>
<para>
It controls the default character set code-page to use when passing
strings to and from COM objects. If set to an empty string, PHP will
assume that you want <constant>CP_ACP</constant>, which is the default
system ANSI code page.
</para>
<para>
If the text in your scripts is encoded using a different
encoding/character set by default, setting this directive will save you
from having to pass the code page as a parameter to the <xref
linkend="class.com"/> class constructor. Please note that by
using this directive (as with any PHP configuration directive), your PHP
script becomes less portable; you should use the COM constructor parameter
whenever possible.
</para>
<note>
<simpara>
This configuration directive was introduced with PHP 5.
</simpara>
</note>
</listitem>
</varlistentry>
<varlistentry id="ini.com.typelib-file">
<term>
<parameter>com.typelib_file</parameter>
</term>
<listitem>
<para>
When set, this should hold the path to a file that contains a list
of typelibraries that should be loaded on startup. Each line of
the file will be treated as the type library name and loaded as
though you had called <function>com_load_typelib</function>.
The constants will be registered persistently, so that the library
only needs to be loaded once. If a type library name ends with the
string <literal>#cis</literal> or <literal>#case_insensitive</literal>,
then the constants from that library will be registered case
insensitively.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<!-- Keep this comment at the end of the file

View file

@ -1,30 +1,62 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<reference id="ref.com">
<title>COM support functions for Windows</title>
<title>COM and .Net (Windows)</title>
<titleabbrev>COM</titleabbrev>
<partintro>
<section id="com.intro">
&reftitle.intro;
<para>
COM is a technology which allows the reuse of code written in any
language (by any language) using a standard calling convention and hiding
behind APIs the implementation details such as what machine the Component is
stored on and the executable which houses it. It can be thought of as a super
Remote Procedure Call (RPC) mechanism with some basic object roots. It
separates implementation from interface.
</para>
COM is an acronym for Component Object Model; it is an object orientated
layer (and associated services) on top of DCE RPC (an open standard) and
defines a common calling convention that enables code written in any
language to call and interoperate with code written in any other language
(provided those languages are COM aware). Not only can the code be
written in any language, but it need not even be part of the same
executable; the code can be loadaed from a DLL, be found in another
process running on the same machine, or, with DCOM (Distributed COM), be
found in another process on a remote machine, all without your code even
needing to know where a component resides.
</para>
<para>
COM encourages versioning, separation of implementation from
interface and hiding the implementation details such as executable location and
the language it was written in.
</para>
There is a subset of COM known as OLE Automation which comprises a set of
COM interfaces that allow loose binding to COM objects, so that they can
be introspected and called at run-time without compile-time knowledge of
how the object works. The PHP COM extension utilitizes the OLE
Automation interfaces to allow you to create and call compatible objects
from your scripts. Technically speaking, this should really be called
the "OLE Automation Extension for PHP", since not all COM objects are OLE
compatible.
</para>
<para>
Now, why would or should you use COM? COM is one of the main ways to glue
applications and components together on the Windows platform; using COM
you can launch Microsoft Word, fill in a document template and save the
result as a Word document and send it to a visitor of your web site. You
can also use COM to perform administrative tasks for your network and to
configure your IIS; these are just the most common uses; you can do much
more with COM.
</para>
<para>
Starting with PHP 5, this extension (and this documentation) was
rewritten from scratch and much of the old confusing and bogus cruft has
be removed. Additionally, we support the instantiation and creation of
.Net assemblies using the COM interoperability layer provided by
Microsoft.
</para>
<para>
Please read <ulink url="&url.zend.comdotnet;">this article</ulink>
for an overview of the changes in this extension in PHP 5.
</para>
</section>
<section id="com.requirements">
&reftitle.required;
<para>
COM functions are only available on the Windows version of PHP.
COM functions are only available for the Windows version of PHP.
</para>
<para>
.Net support requires PHP 5 and the .Net runtime.
</para>
</section>
@ -32,6 +64,124 @@
&reftitle.install;
&no.install;
&windows.builtin;
<para>
You are responsible for installing support for the various COM objects
that you intend to use (such as MS Word); we don't and can't bundle all
of those with PHP.
</para>
</section>
<section id="com.foreach">
<title>For Each</title>
<para>
Starting with PHP 5, you may use PHP's own <xref
linkend="control-structures.foreach"/> statement to iterate
over the contents of a standard COM/OLE IEnumVariant. In laymans terms,
this means that you can use foreach in places where you would have used
<literal>For Each</literal> in VB/ASP code.
</para>
<para>
<example>
<title>For Each in ASP</title>
<programlisting role="php">
<![CDATA[
<%
Set domainObject = GetObject("WinNT://Domain")
For Each obj in domainObject
Response.Write obj.Name & "<br>"
Next
%>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>while() ... Next() in PHP 4</title>
<programlisting role="php">
<![CDATA[
<?php
$domainObject = new COM("WinNT://Domain");
while ($obj = $domainObject->Next()) {
echo $obj->Name . "<br>";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>foreach in PHP 5</title>
<programlisting role="php">
<![CDATA[
<?php
$domainObject = new COM("WinNT://Domain");
foreach ($domainObject as $obj) {
echo $obj->Name . "<br>";
}
?>
]]>
</programlisting>
</example>
</para>
</section>
<section id="com.arrays">
<title>Arrays and Array-style COM properties</title>
<para>
Many COM objects expose their properties as arrays, or using array-style
access. In PHP 4, you may use PHP array syntax to read/write such a
property, but only a single dimension is allowed. If you want to read a
multi-dimensional property, you could instead make the property access
into a function call, with each parameter representing each dimension of
the array access, but there is no way to write to such a property.
</para>
<para>
PHP 5 introduces the following new features to make your life easier:
<itemizedlist>
<listitem>
<para>
Access multi-dimensional arrays, or COM properties that require
multiple parameters using PHP array syntax. You can also write or set
properties using this technique.
</para>
</listitem>
<listitem>
<para>
Iterate SafeArrays ("true" arrays) using the <xref
linkend="control-structures.foreach"/> control structure. This works
because SafeArrays include information about their size. If an
array-style property implements IEnumVariant then you can also use
foreach for that property too; take a look at <xref
linkend="com.foreach"/> for more information on this topic.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section id="com.exceptions">
<title>Exceptions (PHP 5)</title>
<para>
This extension will throw instances of the class <literal>com_exception</literal>
whenever there is a potentially fatal error reported by COM. All
COM exceptions have a well-defined <literal>code</literal> property that
corresponds to the HRESULT return value from the various COM operations.
You may use this code to make programmatic decisions on how to handle the
exception.
</para>
</section>
&reference.com.ini;
@ -43,7 +193,9 @@
<para>
For further information on COM read the <ulink url="&url.comspecs;">COM
specification</ulink> or perhaps take a look at Don Box's
<ulink url="&url.yacl;">Yet Another COM Library (YACL)</ulink>
<ulink url="&url.yacl;">Yet Another COM Library (YACL)</ulink>.
You might find some additional useful information in our FAQ for <xref
linkend="faq.com"/>
</para>
</section>
</partintro>
@ -59,6 +211,7 @@ 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

View file

@ -0,0 +1,6 @@
<note>
<simpara>
This function does not exist in PHP 5; instead, you should use the regular
and more natural OO syntax to access properties or call methods.
</simpara>
</note>

View file

@ -0,0 +1,16 @@
<note>
<para>
As with all the variant arithmetic functions, the parameters for this function
can be either a PHP native type (integer, string, floating point, boolean or
&null;), or an instance of a COM, VARIANT or DOTNET class. PHP native types
will be converted to variants using the same rules as found in the constructor
for the <xref linkend="class.variant"/> class. COM and DOTNET objects
will have the value of their default property taken and used as the variant value.
</para>
<para>
The variant arithmetic functions are wrappers around the similarly named
functions in the COM library; for more information on these functions, consult
the MSDN library. The PHP functions are named slightly differently; for example
variant_add() in PHP corresponds to VarAdd() in the MSDN documentation.
</para>
</note>