Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Robert Basic's Blog:
Creating a chat bot with PHP and Dbus
Jan 09, 2012 @ 17:10:52

Robert Basic has continued his series looking at using Dbus in PHP with this latest post to his blog - using the foundation he's created before to make a chat bot that will listen and respond to commands on a Jabber network.

Now that we know how to use DBus to communicate with Pidgin from PHP and how to listen to DBus signals, it’s time to put it all together by creating a simple chat bot! Nothing fancy, just a simple script that runs somewhere on some server and, by using a Pidgin account, can respond to some basic queries we send it.

His new code listens for an incoming message on the "PurpleInterface", grabs the name of the sender and calls a "PurpleConvImSend" method with the conversation object and the message to send. You can find the complete source for the project on his github account.

tagged: dbus tutorial pigdin extension pecl chat bot jabber

Link:

Robert Basic's Blog:
Listening to Dbus signals with PHP
Dec 26, 2011 @ 17:23:41

Robert Basic has posted a follow up to his first post about using DBase in PHP in this new post. This new tutorial shows you how to listen to signals sent to the waiting PHP script.

The good part is that not can we only call different methods against Pidgin's libpurple API, we can also listen to different signals on different events, that are sent via Dbus. [...] The PHP Dbus extension allows us to watch for one exact signal on an interface, or for all signals on an interface. Of course, we can add watches on multiple interfaces at once.

In his example he shows how to set a listener on the session to watch for an incoming instant message from another source. Sample code is included showing how to set the listener on the interface and be able to tell when a message comes in (watching a $signal interface for an event). You can find more signal catching examples in his github repository.

tagged: dbus signal listen tutorial extension

Link:

Robert Basic's Blog:
Communicating with Pidgin from PHP via D-Bus
Dec 19, 2011 @ 15:10:23

Robert Basic has put together a new tutorial on his blog showing how he connected PHP and Pidgin (the popular chat client) with the help of the DBus extension.

Earlier this week I got an idea of trying to communicate with Pidgin, a chat client, via the terminal. [...] Surely I wasn’t the first one to come up with this idea and after a bit of a googling found out that Pidgin’s libpurple has a nice API for that, exposed via D-Bus. I first planned to write some scripts for this in Python or C, but when I finally sat down over the weekend to hack on this, realized there is a PHP D-Bus extension, thanks to Derick Rethans!

He goes through the whole process you'll need to get it up and working on your system - installing the extension via PECL, creating a DBus proxy to the Pigdin interface and getting a list of the currently connected users. You can find the first versions of this code in his account on github.

tagged: dbus tutorial pigdin extension pecl

Link:

Derick Rethans' Blog:
First release of the D-Bus extension
Apr 06, 2010 @ 17:16:16

Derick Rethans has announced the first official release of his D-Bus extension that makes it possible for PHP applications (and ones built in other languages) to interact directly with each other.

A few days ago I made the first beta release of the D-Bus extension that I have been working on for a while. D-Bus is a message bus system, a simple way for applications to talk to one another. I started working on this because my cellphone. [...] However, many other applications on the Linux desktop speak D-Bus. This includes system services such as the notification daemon, the screen saver and hardware plug-in detection as well as desktop applications such as Pidgin and Empathy.

You can find out more about the extension on its PECL page or check out Derick's presentation on the subject (as presented at the 2010 PHP London conference).

tagged: release dbus extension communication

Link:

Manuel Pichler's Blog:
PHP_Depend jumps on the D-BUS
Nov 19, 2009 @ 18:46:17

Manuel Pichler has a new post today about a feature he's added into the PHP_Depend application that tracks the dependencies in your code - a bit of DBus magic.

Sometimes the parsing and analysis process of PHP_Depend can consume a lot of time to finish, so I always put the shell aside and do something different. Normally I take a look at the shell every few minutes to check if the process has finished, but it also happens that I totally forget that I have started a PHP_Depend process on my system. So I need something that says to me, "Hey, mapi PHP_Depend has finished its job...", and here comes D-BUS in the game.

With the help of the DBus extension, he made a way to have the PHP_Depend process send a message (in his case one similar to a Growl popup) when the dependency checking is done. You'll need the 0.9.0 branch to get the "notify-me" command line option to make it all work.

tagged: phpdepend dbus notify tutorial

Link:

Daniel Cousineau's Blog:
PHP, Mumbles (Growl), and DBus: Sweeet
Feb 13, 2009 @ 16:26:33

Daniel Cousineau has a new post today that looks at his process for getting a Growl-like messaging system up and running in Ubuntu by combining Mumbles and PHP (via a DBus API).

I decided the best easiest route is to access the internal DBus API, however the forums and other resources on the Mumbles site… well... just plain suck. And by suck I mean tell you that something exists and… thaaats about it.

What he did find, thanks to Google, was a tool called D-Feet to help with debugging and a DBus extension for PHP that could add the needed support into his PHP installation. Following a bit of hacking and lots of testing, he was mostly successful. The only side effect is an Exception where the extension cannot correctly catch the Notify signal.

tagged: growl mumbles dbus notification ubuntu dfeet extension

Link:

ThinkPHP Blog:
Mayflower Barcamp: Developing a PHP extension for Skype
Mar 17, 2008 @ 15:24:29

On the ThinkPHP blog today, Andreas Uhsemann has posted about a project that he and fellow Mayflower Barcampers came up with that they thought could be useful (and interesting) to work on - a PHP extension to interface with the Skype communication tool.

At the Mayflower Barcamp a few weeks ago we had a very interesting and promising project: Develop a PHP extension for communication with Skype. Actually this project was a merge between two projects: One was to "develop a PHP extension" - five out of six project members never had written any PHP extension or did any PHP core development before. The other project was the Skype extension, with the goal to have a new PHP function that could send a chat message to a given Skype profile.

As they worked on it, they realized that it was really D-Bus (the message bus system) they needed to interface with, not Skype directly. They include some of the code they used to make the connection - creating the message, setting a few parameters and "send and block" the message out to the D-Bus connection waiting. They've even put the code up on a public CVS repository (on thinkforge.org) if you'd like to download and play with it yourself.

tagged: extension skype interface mayflower barcamp dbus message

Link:


Trending Topics: