This is a simple PHP class for DCOP (written on a PHP 4.3.11 machine, should work on PHP5).
DCOP is some kind of IPC-protocol based on ICE for Unix machines. KDE apps use it and I need it to control a
mediaplayer but any DCOP application can be controlled.
Since DCOP is not very secure out of its own and my scripting neither ;) you better not use this on public
webservers or anything that can be publicly accessed. I will use it in a deamonized process that reads it's command
out of a database and I recommend you doing something similar.
$class->connect() just returns the available applications in an array
$class->disconnect() returns absolutely nothing but resets the necessary variables. You most certainly won't use it
but if you really need to reset something while you're constructing your options with application or function, you
can reset it here (eg. if you take user input and a typo has been made)
$class->application() constructs and validates the application option for the dcop command and returns the
command-line options it will use for dcop
$class->app_function() should be called after you called application() and constructs and validates the function and
returns the command-line options it will use for dcop
$class->error() could be used to explain my pesky error message, you could however during developing your
application use the variables $err_explain and $err_command. I recommend not enabling any of these in live applications,
security through obscurity is better than no security at all :-)
$class->call() executes the dcop command with the options previously constructed
If you call it just with the application constructed you get a list of available functions for that application
If you call it with the function constructed you get a list of arguments for that function
If you call it after you constructed everything correctly, you get the result of the command you executed
$class->execute_dcop() executes the finally dcop command and I would like to look for erroneous input too here but
YOU SHOULD NOT CALL THIS FUNCTION FROM WITHIN YOUR CODE; IT IS FOR INTERNAL USE ONLY AND WILL DISPLAY AN ERROR
MESSAGE. YOU HAVE BEEN WARNED.
For further questions or remarks --> evi@valerieandevi.be
Everything released under the GPL so you should know what to do
|