I've just put out the most significant update to phpFlickr ever. It may very well break your current app. I knew that just switching to the serialized php might introduce some differences, so I went ahead and cleaned up some mistakes I made back when I put out version 1.0. Be sure to thoroughly test any apps if you are replacing an old version of phpFlickr with this one. You can expect phpFlickr 2.x to be almost completely backwards compatible with everything that version 2.0.0 does.
Let me outline the major changes:
- Support for Flickr's new serialized PHP format. This means no more mucking about with slow error-ridden XML parsers to get the results. This also means that until 23 does the same thing, I'm suspending support for their API. Download the latest 1.x version of phpFlickr to use 23.
- Better faster caching. For high performance sites, I was doing some things that were pretty dumb when it came to database caching. Now there is a class property that defines the maximum number of cached results it will allow before it runs the cleanup. This way, it'll only trigger cleanup every once in a while. The default is 1000, change this if you need it larger or smaller than this (1000 should be more than enough for most personal sites).
- Better error handling. In this new version, the $die_on_error is set to false by default. Every method will return a boolean false value if the API returns an error and you can access the error code and message using the getErrorCode() and getErrorMsg() methods. In methods that alter data (e.g. photos_delete) will return a boolean true if there is no error state. Of course, you can always turn the die_on_error flag if you want.
Get it while it's hot!