Manuál PHP | ||
---|---|---|
Předcházející | Další |
COM je technologie, která umožňuje znovupoužít kód napsaný v jakémkoliv jazyce za použití standardního volání a schováním implementačních detailů - jako na kterém počítači je komponenta uložena a který spustitelný soubor ji uchovává - za API. Lze si to představit jako rozšířený mechanismus vzdáleného volání procedur (RPC) se základy objektů. COM odděluje implementaci od rozhraní.
COM podporuje verzování, oddělení implementace od rozhraní a skrytí implementačních detailů jako je umístění spustitelného souboru a jazyku, který byl použit.
Tyto funkce jsou dostupné pouze ve Windows verzi PHP.
K používání těchto funkcí není třeba žádná instalace, jsou součástí jádra PHP.
Verze PHP pro Windows má vestavěnou podporu pro toto rozšíření. K použití těchto funkcí není třeba načítat žádná další rozšíření.
Chování těchto funkcí je ovlivněno nastavením parametrů v php.ini.
Tabulka 1. Com configuration options
Name | Default | Changeable |
---|---|---|
com.allow_dcom | "0" | PHP_INI_SYSTEM |
com.autoregister_typelib | "0" | PHP_INI_ALL |
com.autoregister_verbose | "0" | PHP_INI_ALL |
com.autoregister_casesensitive | "1" | PHP_INI_ALL |
com.code_page | "" | PHP_INI_ALL |
com.typelib_file | "" | PHP_INI_SYSTEM |
Here's a short explanation of the configuration directives.
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.
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 com.autoregister_casesensitive configuration directive.
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.
When this is turned on (the default), constants found in auto-loaded type libraries will be registered case sensitively. See com_load_typelib() for more details.
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 CP_ACP, which is the default system ANSI code page.
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 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.
Poznámka: This configuration directive was introduced with PHP 5.
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 com_load_typelib(). 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 #cis or #case_insensitive, then the constants from that library will be registered case insensitively.
Tyto konstanty jsou definovány tímto rozšířením a budou k dispozici pouze tehdy, bylo-li rozšíření zkompilováno společně s PHP nebo dynamicky zavedeno za běhu.
Více informací o COM naleznete ve specifikaci COM nebo se třeba podívejte na Yet Another COM Library (YACL) Dona Boxe.
Předcházející | Domů | Další |
method_exists | Nahoru | COM |