
The new 1.5 build of the DirectorPHP class includes several benefits compared to the older 1.x builds, notably:
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.
The beta release for DirectorPHP 1.5 is available in the Account Center. Please be sure to read the following upgrade instructions before using.
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!