Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

com_event_sink(3) [php man page]

COM_EVENT_SINK(3)							 1							 COM_EVENT_SINK(3)

com_event_sink - Connect events from a COM object to a PHP object

SYNOPSIS
bool com_event_sink (variant $comobject, object $sinkobject, [mixed $sinkinterface]) DESCRIPTION
Instructs COM to sink events generated by $comobject into the PHP object $sinkobject. 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. PARAMETERS
o $comobject - o $sinkobject -$sinkobject should be an instance of a class with methods named after those of the desired dispinterface; you may use com_print_typeinfo(3) to help generate a template class for this purpose. o $sinkinterface - PHP will attempt to use the default dispinterface type specified by the typelibrary associated with $comobject, but you may override this choice by setting $sinkinterface to the name of the dispinterface that you want to use. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 COM event sink example <?php class IEEventSinker { var $terminated = false; function ProgressChange($progress, $progressmax) { echo "Download progress: $progress / $progressmax "; } function DocumentComplete(&$dom, $url) { echo "Document $url complete "; } function OnQuit() { echo "Quit! "; $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.example.org"); while(!$sink->terminated) { com_message_pump(4000); } $ie = null; ?> SEE ALSO
com_print_typeinfo(3), com_message_pump(3). PHP Documentation Group COM_EVENT_SINK(3)

Check Out this Related Man Page

DEFINE(3)								 1								 DEFINE(3)

define - Defines a named constant

SYNOPSIS
bool define (string $name, mixed $value, [bool $case_insensitive = false]) DESCRIPTION
Defines a named constant at runtime. PARAMETERS
o $name - The name of the constant. o $value - The value of the constant; only scalar and null values are allowed. As of PHP 7 it also possible to use array value. Scalar val- ues are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and may cause unpredictable behavior. o $case_insensitive - If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Con- stant represent different values. Note Case-insensitive constants are stored as lower-case. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------+ | 7.0.0 | | | | | | | | | | array values are allowed. | | | | +--------+---------------------------+ EXAMPLES
Example #1 Defining Constants <?php define("CONSTANT", "Hello world."); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." // Works as of PHP 7 define('ANIMALS', array( 'dog', 'cat', 'bird' )); echo ANIMALS[1]; // outputs "cat" ?> SEE ALSO
defined(3), constant(3), The section on Constants. PHP Documentation Group DEFINE(3)
Man Page