Monday, October 27, 2008

PEAR Bug Triage Day Results (October 25th/26th)

This was a productive one! There was a general aim of getting unit tests just plain working, as well as responding to other QA metrics, like PHP_CodeSniffer.

The people involved this time around were:
cweiske, doconnor, kguest, amir, justinpatrin, till, avb, Tatsuya Tsuruoka, brettbieber, and I'm sure there are one or two I missed. Regardless, a huge thanks to all who participated.

Achievements


Commits galore, as well as on the wiki

PHPCS patches


There's a lot of code in PEAR, and we just keep getting more of it. We make use of tools like PHP_CodeSniffer to help us control it, but it's a big job keeping everything consistent.

We spruced up:
* Validate (amir)
* HTTP_Session2 (till)
* Gtk2_PHPConfig (kguest)
* Net_Wifi (cweiske)
* File_XSPF (doconnor)
* Net_Whois (doconnor)

And have seen a general fall in errors and warnings all week:
Date Errors Warnings
2008-10-20 204611 59329
2008-10-21 204527 59302
2008-10-22 204476 59288
2008-10-23 204480 59291
2008-10-24 204480 59292
2008-10-25 204482 59291
2008-10-26 204450 59166

There are also more detailed statistics available.

PHPUnit and Unit Tests


We started off at around 518 broken tests (16.21%), and got that down to 321 broken tests (10%).
* Text_Wiki (justinpatrin)
* DB_DataObject_FormBuilder (justinpatrin)
* Image_Color (doconnor)
* Services_Amazon (Tatsuya Tsuruoka)
* File_Find (doconnor)
... and more.

There's a number of patches that have been written but not applied, so it's only a matter of time..


Other


* Triage the latest bugs (doconnor: done-ish)
* HTTP_Client 1.2.1 released (avb)
* File_XSPF missing package.xml (kguest)
* MDB2_Schema test coverage (Igor Feghali)
* I18N_UnicodeString (in CVS and fixed by kguest)
* PHP_Fork into CVS (cweiske)
* Fix Validate_AU unit tests (doconnor released Validate_AU-0.1.2)
* Some talk of getting a working CI box back up and running

Next triage is looking like the 15th/16th of November

Saturday, October 25, 2008

PEAR Bug Triage Day, October 25th/26th

Come and join us, irc.efnet.org #pear-bugs

See the wiki for more details on what we are doing.

Tuesday, October 14, 2008

Evening Ride

Another week, another ride.


View Larger Map

I left in the evening and let me tell you: wind chill and bike shorts at night do not mix.

Approx 51km, it took me a few hours!

Tuesday, October 07, 2008

Interacting with Google Calendar via Jabber/XMPP (Google Talk)

So, you've got a machine with PHP on it floating around, and your quickly-add-to-google-calendar extension isn't working for firefox 3.

You could go the ubiquity route, but... what if you wanted something with a bit more personality?

With that in mind, I'd like to share with you all xmppcalendarbot.

He's written in PHP and sits in your buddy list.

There's a bit of setup involved, but it is well worth it.

Get the code


Do:
cd ~/
svn checkout http://xmppcalendarbot.googlecode.com/svn/trunk/ xmppcalendarbot
pear channel-discover pear.phpmafia.net
pear install phpmafia/Zend

Other bits to remember: you probably want to make sure the mb_string extension is enabled!

Setup the accounts


If you want, you can set it up to use your own gmail accounts (make sure you have access to google calendar!), or you can create a new set of google accounts just for your bot.

I opted for the second option, so I didn't end up trashing my personal data.

If you go for the two accounts option, make sure that you add your primary gmail account with the ability to manage events and sharing.

Get the details and stick them into a config.php file:

<?php
$user = 'you@gmail.com';
$pass = 'fishbarmonkey';


Make rocket go now!


php ~/xmppcalendarbot/main.php

... and add the bot as your friend. It doesn't hurt to log into the account using pidgin to get over this initial hurdle if you need to.

Talking to your new friend



Quit


(23:24:53) daniel.oconnor@gmail.com/Home: quit
(23:24:54) your.calbot@gmail.com: Just what do you think you're doing, Dave?...
(23:24:57) your.calbot@gmail.com: Dave...
(23:25:00) your.calbot@gmail.com: I really think I'm entitled to an answer to that question...
(23:25:03) your.calbot@gmail.com: I know everything hasn't been quite right with me, but I can assure you now, very confidently, that it's going to be alright again...

Quit now


(23:30:59) daniel.oconnor@gmail.com/Home: quit now
(23:31:00) your.calbot@gmail.com: Nap time! Zzzzz

Help


(23:27:08) daniel.oconnor@gmail.com/Home: help
(23:27:08) your.calbot@gmail.com: Commands available: quit, restart, help, news, break, agenda, reminder, when

Reminder


(23:27:58) daniel.oconnor@gmail.com/Home: reminder cook a delicious meal, tomorrow at 7pm
(23:28:04) your.calbot@gmail.com: Mmm hmm, got it.
(23:28:04) your.calbot@gmail.com: Ok: I've booked it in, you'll get a reminder 30 minutes before
(23:28:24) daniel.oconnor@gmail.com/Home: reminder shop for your meal, tomorrow morning 8am
(23:28:26) your.calbot@gmail.com: Mmm hmm, got it.
(23:28:27) your.calbot@gmail.com: Ok: I've booked it in, you'll get a reminder 30 minutes before

When is...


(23:28:44) your.calbot@gmail.com: Found you have 2 event(s) for meal
(23:28:44) your.calbot@gmail.com: 1. cook a delicious meal (2008-10-08 08:30:00am to 2008-10-08 09:30:00am)
(23:28:44) your.calbot@gmail.com: 2. shop for your meal, morning (2008-10-07 09:30:00pm to 2008-10-07 10:30:00pm)

News


(23:30:19) daniel.oconnor@gmail.com/Home: news http://clockwerx.blogspot.com/atom.xml 3
(23:30:21) your.calbot@gmail.com: Hello! We've got new Atom entries (25), showing up to 3
(23:30:22) your.calbot@gmail.com: Blair Athol to Crafers by CloCkWeRX
(23:30:22) your.calbot@gmail.com: A pox on your XAMPP and or houses (both of them?) by CloCkWeRX
(23:30:22) your.calbot@gmail.com: Asterisk and Sneaky Plans by CloCkWeRX

Agenda


(23:32:08) daniel.oconnor@gmail.com/Home: agenda tomorrow
(23:32:10) your.calbot@gmail.com: For 2008-10-08 you have 1 event(s)
(23:32:11) your.calbot@gmail.com: 1. cook a delicious meal (2008-10-08 06:00:00pm to 2008-10-08 07:00:00pm)
(23:32:24) daniel.oconnor@gmail.com/Home: agenda today
(23:32:26) your.calbot@gmail.com: For 2008-10-07 you have 1 event(s)
(23:32:27) your.calbot@gmail.com: 1. shop for your meal, morning (2008-10-08 07:00:00am to 2008-10-08 08:00:00am)

What's next?


Obviously I need to iron out some timezone conversion issues and generally provide some polish; but now I have a calendar agent I can ask to book me a holiday.

Specific improvements are going to include things like adding guests to events and working out command syntax.

I'm also going to think about the news reader side of it a bit more.

I can imagine you have an entire entourage of these, and you share them with your friends - one is the group calendar bot, another tells you about a certain RSS feed every hour (svn commits?), another is your identi.ca bot...

Sunday, October 05, 2008

Blair Athol to Crafers

I haven't ridden my bike in about two months, so doing:

View Larger Map

... was the obvious way to spend my Saturday.

I will however recommend it, as riding back at night after a beer or two at what appears to be close to the sound barrier is insane fun.

Thursday, October 02, 2008

A pox on your XAMPP and or houses (both of them?)

I dislike XAMPP incredibly. Every time I get someone asking a question on why-doesn't-pear-work; or I-can't-include-something, it tends to be XAMPP.

I'm sure it's a great idea to minimize the entry level (I've never used it), but unless people new to PHP set up and configure their own instance of php (php.ini is not that hard), they get immediately stuffed; because things are not where they should be by default.

I'm all for making things easier. Look at how easy it is to install python or perl - an MSI, and it just kind of works. You also don't have to think about include_path magic so much.
If PHP could work like that on Windows, hurray - but it doesn't. Not with XAMPP and PEAR.

How do I know - this on #pear

(10:11:35 AM) pc__: "DB Error: not found" this is driving me crazy
... snip ...
(10:14:09 AM) pc__: Unable to include the DB/mysql.php file
... snip ...
(10:18:53 AM) pc__: so, is DB/mysql.php supposed to already exist? or is it part of some additional package that i need to get?
... snip ...
(10:36:41 AM) pc__: mysql.php simply doesnt exist anywhere. i have no DB folder under PEAR, and i already tried to use mysqli, same result.
(10:36:52 AM) pc__: i think its because this is xampp lite
... snip ...
(10:37:07 AM) CloCkWeRX: pear install -f DB
(10:38:07 AM) pc__: im now on windows
(10:41:41 AM) pc__ left the room (quit: Quit: ChatZilla 0.9.83 [Firefox 3.0.3/2008092417]).


Wonderful. XAMPP just turned a developer completely off of PEAR because they made it very simple to install something, then changed around the defaults and other basic expectations, so that it was very hard to install other things - like PEAR::DB, properly.

Asterisk and Sneaky Plans

I want to make a small company which does customised installations of Jabber servers, and possibly Asterisk for small business - say, 30 or more people in the company.

Step one: Make me an RSS feed jabber bot, and viola: you have a recipe for a really slick communication tool integrated with existing other tools.

Some example scenarios:
Asterisk and a jabber bot watch people's status: if you are out to lunch according to pidgin (or your jabber client), route the calls intelligently to the next available person.

You could build service specific jabber bots / agents to do tasks coupled with another system - for instance, you could use it to ask "what price is a (barcode)" or "call Steve mobile" (asterisk locates the Steve you want and starts dialling, or perhaps finds the number from your CRM system).

More neatly, if you had, say, a stock level monitoring system or something else which could put out RSS, the Jabber bot could inform you "We are low on X".

Applications to target first:
* A Jabber bot that provides a neat interface to the assorted Google Data feeds (email, calendar)
* A Jabber bot that deals with RSS

... and then, you can start doing all sorts of neat things with inhouse systems - ie, SugarCRM or others.

Update
That was stupidly easy. See Interacting with Google Calender via Google Talk

1) Get XMPPHP
2) Do this:

<?php
require_once dirname(__FILE__) . '/external/xmpphp/XMPPHP/XMPP.php';
require_once dirname(__FILE__) . '/external/xmpphp/XMPPHP/Log.php';


$user = 'you@gmail.com';
$pass = 'password';
$url = dirname(__FILE__) . '/atom.xml';

// Or load from config
include 'config.php';


// And now the start

$feed = simplexml_load_file($url);
$feed->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');

$entries = $feed->xpath('//atom:entry');

if (empty($entries)) {
die();
}

$conn = new XMPPHP_XMPP('talk.google.com', 5222, $user, $pass, 'xmpphp', 'gmail.com', $printlog=true, $loglevel=LOGGING_INFO);
$conn->connect();
$conn->processUntil('session_start');
$conn->message($user, "New entries: " . count($entries));

$entries = $feed->xpath('//atom:entry');
foreach ($entries as $entry) {
$conn->message($user, (string)$entry->title . " by " . (string)$entry->author->name);
}
$conn->disconnect();

3) Set up a cron job or similar to message you every few hours. Viola.