Releases: thomaswelton/laravel-rackspace-opencloud
Configurable RAXSDK_TIMEOUT
Add delete method
Merge pull request #9 from cadyfatcat/master Added delete function for CDN objects and fixed typo on function name
Laravel 4.1 Support
Support for Laravel 4.1
Bug fix - Used rackspace 1.5.x
Fixed issues when using rackspace version 1.6
Locked down rack space open cloud to version 1.6.x
0.2.1
Bug fix - using this inside closure
Directory Sync, Automatic CDN urls
Upload files via the command line.
Synchronize a whole directory. Copies all files to /public/assets
php artisan cdn:sync public/assets
Copies all files to /assets trimming 'public' from the path
php artisan cdn:sync public/assets --trim=public
The sync command will save a file adjacent to the synchronized directory. It contains the http and https urls for your container. Along with a md5 hash of the directory.
In this way when a file changes inside a directory and is reuploaded you get a new cache busted URL.
If you are using the URL helper then it will return a CDN url for a file, if it finds a *.cdn.json file adjacent to one of it's parent directories.
URL::asset('assets/image.jpg');
You should be able to run php artisan cdn:sync public/assets --trim=public
before or during a deployment and once complete all files being called by URL::asset()
will return a CDN resource
File Upload and Container suport
OpenCloud::upload($container, $file, $name = null)
- $container - (string) Name of the container to upload into
- $file - (string / UploadedFile) Path to file, or instance of 'Symfony\Component\HttpFoundation\File\UploadedFile' as returned by Input::file()
- $name - (string) Optional file name to be used when saving the file to the CDN.
Example:
Route::post('/upload', function()
{
if(Input::hasFile('image')){
$file = OpenCloud::upload('my-container', Input::file('image'));
}
$cdnUrl = $file->PublicURL();
// Do something with $cdnUrl
return Redirect::to('/upload');
});