Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class photo {
- public static $version = '1.0';
- function photo() {
- add_include_path($GLOBALS['SIGNAL']['LIBRARIES']['PATH'].'cloudfilesAPI/');
- add_include_path($GLOBALS['SIGNAL']['LIBRARIES']['PATH'].'cloudfilesAPI/ZendFramework/library');
- require_once 'Compass/Service/Rackspace/Cloudfiles.php';
- $this->cf = new Compass_Service_Rackspace_Cloudfiles($GLOBALS['SIGNAL']['RACKSPACE_USER'],$GLOBALS['SIGNAL']['RACKSPACE_API_KEY']);
- $this->cf->auth();
- }
- // the actual upload i am calling this method 3 times on 3 files ( 50kb , 10 kb , 20 kb)
- private function uploadToRackspaceCloudFiles ( $filePath ,$containerName , $fileUri)
- {
- //__p(array($filePath ,$containerName , $fileUri));
- $contents = file_get_contents($filePath);
- try {
- $this->cf->putObject($containerName.'/'.$fileUri, $contents);
- }
- catch(Exception $e){
- }
- }
Add Comment
Please, Sign In to add comment