Visit SlideShowPro.net  Community Forums
SlideShowPro Support Wiki
  
SlideShowPro Director

Using the DirectorPHP 1.5 beta

Note: The DirectorPHP 1.5 release is currently in beta. Use it at your own risk, and be especially mindful of the upgrading directions below if you are upgrading existing DirectorPHP applications.

The new 1.5 build of the DirectorPHP class includes several benefits compared to the older 1.x builds, notably:

  • Requests are now made via GET, which has less overhead than the previous POST requests.
  • Requests now use JSON instead of XML. Because JSON handles encoding in a cleaner way, we don't have to do as much processing of the data to ensure it is clean.
  • Methods in the DirectorPHP class now have open-ended options assignment, meaning when we add options to the API you won't have to update the DirectorPHP classes, just your code.

The net effect of the changes in 1.5 is that it should be faster than previous versions while also being much easier to work with moving forward.

Downloading

The beta release for DirectorPHP 1.5 is available in the Account Center. Please be sure to read the following upgrade instructions before using.

Upgrading from previous versions

Once you update your classes folder, most of your code will work without modifications except for one key change. Previously, when looping through collections of content or albums, you would do things like this (see line 4):

<?php

   // Loop through album content
   $contents = $album->contents[0];
   // For some, the above looks like $album->contents->content
   foreach($contents as $content) {
      echo $content->src . '<br />';
   }
?>

In 1.5, the returned object is properly formed, so there is no need to reference it via content[0]. You now need to just do this (again, line 4):

<?php

   // Loop through album content
   $contents = $album->contents;
   foreach($contents as $content) {
      echo $content->src . '<br />';
   }
?>

That's the only update you need to make. The rest of your code should work as it did before, just faster!

Page last modified by bdaily on May 23, 2011, at 08:18 AM
© 2011 SlideShowPro. All Rights Reserved.