PHP Classes

DCOP calls for PHP: Execute actions of KDE applications using DCOP

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2006-01-08 (9 years ago) RSS 2.0 feedNot enough user ratingsTotal: 514 All time: 5,355 This week: 1,052Up
Version License Categories  
dcop_php_class 1.0GNU General Publi...Networking, GUI
Description Author  

This class can be used to execute actions in KDE applications running in a local desktop machine.

It establishes a DCOP protocol connection to retrieve the list of currently running KDE based applications, as well the list of actions supported by a given application. Then it can validate arguments and execute any of the supported application actions.

You can for example connect to your mediaplayer and control it.

Innovation Award  
PHP Programming Innovation award nominee
January 2006
Number 9
DCOP is a very interesting technology for communicating with desktop applications for KDE. KDE is a very popular desktop environment for the Linux platform.

The DCOP protocol can be used to control applications from any external scripting language.

This class makes it possible to use PHP as a scripting language that controls any DCOP capable desktop application.

Manuel Lemos
Picture of Guru Evi
Name: Guru Evi <contact>
Classes: 2 packages by
Country: United States United States
Age: 32
All time rank: 2437303 in United States United States
Week rank: 1623 Up170 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

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 

For further questions or remarks -->
Everything released under the GPL so you should know what to do
  Files folder image Files  
File Role Description
Plain text file dcop.class.php Class Actual class
Accessible without login Plain text file example.php Example Example Script
Accessible without login Plain text file COPYING Lic. The GPL License
Accessible without login Plain text file README Doc. README

 Version Control Unique User Downloads Download Rankings  
 0%Total:514All time:5,355
 This week:0This week:1,052Up