Added comments Other minor changes
The script echoes the `user` and `api_key`, making it un-secure when part of a deployment strategy (i.e. Capistrano recipe). I found the most secured to be to store the `user` and the `api_key` on the server where the application is being deployed as part of the setup (i.e. /shared/path/rcfu/.RFUser, /shared/path/rcfu/.RFKey) and use them as part of the deployment in a command like this: ./scp-cloudfiles.sh.php \ -u=`cat /shared/path/rcfu/.CFuser` \ -k=`cat /shared/path/rcfu/.CFKey` \ -c=<container> \ -p=<path>
Determine if existing object (folder/file) exists in the container, ignore it and move to the next file. The main purpose of these changes was to upload over 370k images and videos, however any exceptions caused the script to abort, and having to start over from start. Exception try/catchs added as well to *hopefully* prevent from unexpected errors during transfers. Which I did experience using Mike's original code. Hence the reason for these changes. TODO: Add parameter to force overwriting existing files or ignore them. Update to latest php-cloudfiles API current version I'm aware of 1.6.2.
Should upload files inline instead of compiling a list of all files into an array first--which poses both a potentially huge delay and a memory problem. Got forward-slashes working in object names.
file and create containers automatically.