Fixes for new PHP API

Russell Garrett rg@tcslon.com
Mon, 8 Dec 2003 16:36:59 -0000


After hitting upon another obscure bug in the old PHP API, I finally took
the plunge and switched last.fm over to using the new API. It took quite a
while, as I found a few bugs in the new API too.

This PHP API now runs the audioscrobbler.com submission system stably, as
well as the live last.fm site.

Here's a (mostly from memory) summary, if you want full details, read the
diff file.

- Fixed spelling of "persistent" and "integer". Because I'm picky like that.
Note: this breaks compatability with the "persistant" parameter in the old
version.
- Fixed notices with error_reporting(E_ALL) (mainly uninitialised
variables). I strongly suggest you develop using this - it catches a lot of
bugs, such as this one:
- Fixed differences in spelling between COMPRESSION_SAVINGS and
COMPRESS_SAVINGS constants.
- Fixed bug in _set() where if memcached sends two newlines as opposed to
one (as seems to happen sometimes), _set fails, and "STORED" is left in the
buffer to foul up a subsequent get().
- Changed one instance of print() to trigger_error().

The 341-line patch is available here:

http://www.last.fm/memcached-client-lastfm.diff

--------------------------------------------------------------------
Russ Garrett                                            russ@last.fm
                                                      http://last.fm