rackspace/php-opencloud — pull request #246 by ianwsperber (2013-12-12 01:11:23+00:00)
Title: Fixes to DirectorySync.php that prevent errors

Fixed some errors I encountered when using the container class's new uploadDirectory function. My fixes are in DirectorySync.php's execute function.

1. DirectorySync.php would attempt to fopen files for reading without checking if file is readable. Added a quick check with is_readable()

2. The $requestBody object was being passed to the $requests array, which prevented garbage collection and prevented the file stream for $requestBody from being closed. When adding many files (~100) this could cause a PHP error due to too many files being open. Cast to string before adding to array instead, allowing files to be closed.