Skip to content

NoseRub

NoseRub is a project started by Dirk Olbertz of Blogscout fame. The idea of NoseRub is that it works as a protocol to aggregate data of decentralized social networks. If you want to check it out, the code of a sample application in its early stages is hosted at Google Code. The goal of NoseRub is that everyone can manage and/or host his/her own social network. By separating the profile, the network, and the data, everything will become portable to a great extent. You stay in control of your data, and if any of your friends update their data, these changes will automagically be incorporated into your app.

NoseRub was shown in public for the first time at BarCamp Cologne 2 (one of the most eagerly awaited sessions), where we could see the sample app on two local webservers. It was built around the CakePHP framework, so the structure of the code is very clearly laid out. Of course, because of its early status, many questions arose at the BarCamp session which need to be clarified and resolved (security concerns, technical specifiations). But all in all, the presentation left most of the participants in awe and/or enthusiasm. And so, like many others might already have done or will do within the next few days, I downloaded and installed NoseRub on my local server. What can I say, it works great even in its raw state. My guess is, that developers will improve it very quickly, add new services along the way, so that by the end of the year we should have a great application that helps us take over control over our social networks. Dirk published a quick tour of the sample app, check it out. I will certainly post more about NoseRub, so stay tuned.

The Observer Pattern and PHP4

Matt Zandstra wrote a great and highly recommended article about The Observer Pattern for the Zend Developer Zone. The tutorial is geared at intermediate and expert users, and of course users of PHP5. Now, for those of you who - like me - sometimes still have to work with PHP Version Four, the example won't work out of the box.

Since the observer pattern came in quite handy for my current project, I'd like to share the minor fixes I had to apply to the code. The methods attach() and detach() are the only two methods you'll have to change. Just edit them like so:


function attach($obs) {
    $this->observers[get_class($obs)] = $obs;
}

function detach($obs) {
    unset($this->observers[get_class($obs)]);
}
 

I don't know why Matt used delete() to detach an observer because in the manual it says under delete(): This is a dummy manual entry to satisfy those people who are looking for unlink() or unset() in the wrong place. Whatever, I hope some of you will find my entry useful when hunting for this specific problem.