New Release: phpSmug 2.0.2

Just a small minor update to phpSmug that resolves the over zealous clearCache() (Ticket #3) and some code tidying to get phpSmug a bit closer to being E_STRICT "compliant" (Ticket #2). Sadly we're still tied by PEAR for full compliance, bit for the moment all the code I have control over works with E_STRICT.

As usual, it's available for download from the download page.


  1. Aaron

    Hi,

    Thanks for this great wrapper. I'm having a problem enabling fs caching. Is caching supposed to work across phpSmug objects, or just during the lifetime of an object? If it's just per object, then nevermind.

    If it's across objects, I'm calling enableCache() right after object creation, and the cache file is being correctly created when I make my first method call. But when I create a new object and make the exact same method call, a new cache file is created with the exact same name (I can see the timestamp change).

    Am I missing something obvious?

    Thanks,
    Aaron.

  2. Aaron

    Humm....nevermind. I can see now that it *is* using the cache file. I guess I don't understand why the file timestamp keeps changing, but it appears to be working fine.

    Aaron.

  3. Colin

    Hi Aaron

    The caching will work across objects as the caching doesn't really care about the objects, just the location and filenames used. The filename used for caching is a md5sum of the request you've made with the request unique data stripped out. Provided the requests are the same between objects they will refer to the same cache file.

    You do raise a valid point about the timestamp and I've just realised that I re-cache the data I've just read from the cache file. This poses a potential problem in that the cache may never be updated if a site is particularly busy (we'll get in a cache read/write loop).

    I've created a new bug for it (#4) and will update the wrapper soon (I've got some other testing and changes to integrate first).

    Thanks for pointing this out.
    Colin

  4. Aaron

    Thanks!

  5. Aaron

    Your bug report seems to indicate that this is for file cache only, but if I'm reading your code right I think it applies to db cache as well. You update the expiration if a record already exists for the request hash.

  6. Colin

    Yes, it does affect all caching - both DB and file. In retrospect, I could have worded the first part of my explanation a bit better. The cache() call should be a couple of lines sooner in the code.

  7. Colin

    I've reworded the ticket to be clearer that it affects both DB and FS caching.

  8. Brian Steere

    Just started playing with SmugMug and I am currently using this wrapper to create an uploader. The problem I ran into was the wrapper is the images_upload method was posting to api.smugmug.com instead of upload.smugmug.com which was causing the upload to fail.

  9. Colin

    Brian: It shouldn't make a difference. They both should work in exactly the same way. I've just tested using a simple example and it works a treat.

    I'll email you offline to see if we can troubleshoot this further.

Have A Comment?