- Request a connection name
- Register a class that provides methods
- Introspection is not yet supported
<?php
$d = new Dbus( Dbus::BUS_SESSION, true );
$d->requestName( 'nl.derickrethans.test' );
$d->registerObject(
'/nl/derickrethans/test', 'nl.derickrethans.test', 'testClass' );
class testClass {
static function echoOne( $a ) {
return $a;
}
static function echoTwo( $a, $b ) {
return new DbusSet( $a, $b );
}
}
do {
$s = $d->waitLoop( 1000 );
} while ( true );
?>