com::__construct
(PHP 4 > 4.1.0, PHP 5, PHP 7)
com::__construct — com class constructor
Description
$module_name
[, mixed $server_name
= NULL
[, int $codepage
= CP_ACP
[, string $typelib
]]] )Constructs a new com object.
Parameters
-
module_name
- Can be a ProgID, Class ID or Moniker that names the component to load. A ProgID is typically the application or DLL name, followed by a period, followed by the object name. e.g: Word.Application. A Class ID is the UUID that uniquely identifies a given class. 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 LDAP: as a moniker to use the ADSI interface to LDAP.
-
server_name
-
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. If you specify a non-NULL
value for server, PHP will refuse to load the object unless the configuration option is set toTRUE
.If
server_name
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 directive.DCOM server name key type description Server string The name of the server. Username string The username to connect as. Password string The password for Username. Flags integer One or more of the following constants, logically OR'd together: CLSCTX_INPROC_SERVER
,CLSCTX_INPROC_HANDLER
,CLSCTX_LOCAL_SERVER
,CLSCTX_REMOTE_SERVER
,CLSCTX_SERVER
andCLSCTX_ALL
. The default value if not specified here isCLSCTX_SERVER
if you also omit Server, orCLSCTX_REMOTE_SERVER
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. -
codepage
-
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, which means that it will
propagate to objects and variants returned from the object.
Possible values are
CP_ACP
(use system default ANSI code page - the default if this parameter is omitted),CP_MACCP
,CP_OEMCP
,CP_SYMBOL
,CP_THREAD_ACP
(use codepage/locale set for the current executing thread),CP_UTF7
andCP_UTF8
. You may also use the number for a given codepage; consult the Microsoft documentation for more details on codepages and their numeric values.
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-com.construct.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.