VIII. Support COM pour Windows

Introduction

COM est une technologie qui permet la réutilisation de code écrit dans n'importe quel langage, en utilisant une convention d'appel standardisée, et un masquage des détails d'implémentations derrière des API (tels que le nom de la machine de stockage, ou le programme d'exécution). Elle peut être considérée comme un super mécanisme d'appel distant (Remote Procedure Call, RPC), avec des racines orientées objets. COM sépare l'implémentation de l'interface.

COM encourage le versionnage, la séparation de l'implémentation et de l'interface, et le masquage des détails d'implémentation, tels que le programme d'exécution ou le langage de programmation.

Pré-requis

Les fonctions COM sont uniquement disponibles sur les versions Windows de PHP. Elles ont été ajoutées à partir de PHP 4.0.

Installation

Il n'y pas d'installation nécessaire pour utiliser ces fonctions, elles font parties du coeur de PHP.

La version Windows de PHP dispose du support automatique de cette extension. Vous n'avez pas à ajouter de librairie supplémentaire pour disposer de ces fonctions.

Configuration à l'exécution

Le comportement de ces fonctions est affecté par la configuration dans le fichier php.ini.

Tableau 1. Options de configuration de Com

NomDéfautModifiable
com.allow_dcom"0"PHP_INI_SYSTEM
com.autoregister_typelib"0"PHP_INI_SYSTEM
com.autoregister_verbose"0"PHP_INI_SYSTEM
com.autoregister_casesensitive"1"PHP_INI_SYSTEM
com.typelib_file""PHP_INI_SYSTEM
Pour plus de détails et d'informations sur les constantes PHP_INI_*, voir ini_set().

Constantes prédefinies

Ces constantes sont définies par cette extension, et ne sont disponibles que si cette extension a été compilée avec PHP, ou bien chargée au moment de l'exécution.

CLSCTX_INPROC_SERVER (entier)

CLSCTX_INPROC_HANDLER (entier)

CLSCTX_LOCAL_SERVER (entier)

CLSCTX_REMOTE_SERVER (entier)

CLSCTX_SERVER (entier)

CLSCTX_ALL (entier)

VT_NULL (entier)

VT_EMPTY (entier)

VT_UI1 (entier)

VT_I2 (entier)

VT_I4 (entier)

VT_R4 (entier)

VT_R8 (entier)

VT_BOOL (entier)

VT_ERROR (entier)

VT_CY (entier)

VT_DATE (entier)

VT_BSTR (entier)

VT_DECIMAL (entier)

VT_UNKNOWN (entier)

VT_DISPATCH (entier)

VT_VARIANT (entier)

VT_I1 (entier)

VT_UI2 (entier)

VT_UI4 (entier)

VT_INT (entier)

VT_UINT (entier)

VT_ARRAY (entier)

VT_BYREF (entier)

CP_ACP (entier)

CP_MACCP (entier)

CP_OEMCP (entier)

CP_UTF7 (entier)

CP_UTF8 (entier)

CP_SYMBOL (entier)

CP_THREAD_ACP (entier)

VARCMP_LT (entier)

VARCMP_EQ (entier)

VARCMP_GT (entier)

VARCMP_NULL (entier)

NORM_IGNORECASE (entier)

NORM_IGNORENONSPACE (entier)

NORM_IGNORESYMBOLS (entier)

NORM_IGNOREWIDTH (entier)

NORM_IGNOREKANATYPE (entier)

NORM_IGNOREKASHIDA (entier)

DISP_E_DIVBYZERO (entier)

DISP_E_OVERFLOW (entier)

MK_E_UNAVAILABLE (entier)

Voir aussi

Pour plus d'informations sur les objets COM, lisez les spécifications COM ou bien jetez un oeil au livre de Don Box (en anglais) : Yet Another COM Library (YACL).

Table des matières
COM -- Classe COM
DOTNET -- La classe DOTNET
variant -- classe VARIANT
com_addref --  Incrémente le compteur de références (déconseillé)
com_create_guid --  Génère un identifiant unique global
com_event_sink --  Connecte des évènements d'un objet COM sur un objet PHP
com_get_active_object --  Returns a handle to an already running instance of a COM object
com_get --  Lit la valeur d'une propriété d'un composant COM
com_invoke --  Appelle une méthode d'un composant (déconseillé)
com_isenum -- Récupère un IEnumVariant (déconseillé)
com_load_typelib -- Charge un Typelib
com_load --  Crée une référence sur un composant COM (déconseillé)
com_message_pump --  Traite un message COM en attendant jusqu'à timeoutms millisecondes
com_print_typeinfo --  Affiche une définition de classe PHP pour une interface répartissable
com_propget -- Alias de la fonction com_get()
com_propput -- Alias de la fonction com_set()
com_propset -- Alias of com_set()
com_release --  Décrémente le compteur de références.
com_set --  Modifie une propriété d'un composant COM
variant_abs --  Returns the absolute value of a variant
variant_add --  "Adds" two variant values together and returns the result
variant_and --  performs a bitwise AND operation between two variants and returns the result
variant_cast --  Convert a variant into a new variant object of another type
variant_cat --  concatenates two variant values together and returns the result
variant_cmp --  Compares two variants
variant_date_from_timestamp --  Returns a variant date representation of a unix timestamp
variant_date_to_timestamp --  Converts a variant date/time value to unix timestamp
variant_div --  Returns the result from dividing two variants
variant_eqv --  Performs a bitwise equivalence on two variants
variant_fix --  Returns the integer portion ? of a variant
variant_get_type -- Returns the type of a variant object
variant_idiv --  Converts variants to integers and then returns the result from dividing them
variant_imp --  Performs a bitwise implication on two variants
variant_int --  Returns the integer portion of a variant
variant_mod --  Divides two variants and returns only the remainder
variant_mul --  multiplies the values of the two variants and returns the result
variant_neg --  Performs logical negation on a variant
variant_not --  Performs bitwise not negation on a variant
variant_or --  Performs a logical disjunction on two variants
variant_pow --  Returns the result of performing the power function with two variants
variant_round --  Rounds a variant to the specified number of decimal places
variant_set_type --  Convert a variant into another type. Variant is modified "in-place"
variant_set --  Assigns a new value for a variant object
variant_sub --  subtracts the value of the right variant from the left variant value and returns the result
variant_xor --  Performs a logical exclusion on two variants