Allows you to host all or part of the assets folder on a cloud storage container (CDN).
I would consider this beta quality software. We're using it on a couple production sites but it has not yet been widely tested across different configurations. You could experience some flakiness and may want to keep a backup of your assets initially until you've put it through it's paces, especially if not using LocalCopy mode.
Support: ![Gitter](https://badges.gitter.im/Join Chat.svg)
Assuming you have a CloudFiles container called site-uploads:
mysite/_config/cloudassets.yml:
---
name: assetsconfig
---
CloudAssets:
map:
'assets/Uploads':
Type: RackspaceBucket
BaseURL: 'http://yourcdnbaseurl.com/'
Container: site-uploads
Region: ORD
Username: yourlogin
ApiKey: yourkey
LocalCopy: false
You can map multiple folders in this way or just map the whole assets folder.
CloudAssets.wrappers
. Note that any subclass that is
not wrapped will continue to function normally and will not use the cloud.CloudAssets.file_placeholder
config).
NOTE: this behaviour can be changed with the LocalCopy key in the bucket config.
If that is true, the file will be kept in tact locally and the modification time
will be used to keep the cloud version in sync.This setup allows you to forgo mounting the cloud storage via s3fs, CloudFuse, etc but shouldn't require changes to the Silverstripe file subsystem.
Contributions welcome by pull request and/or bug report. Please follow Silverstripe code standards (tests would be nice).
I would love for someone to implement some other drivers - S3, Swift, Google, etc. It's very easy to implement drivers - just extend CloudBucket and implement a few methods.
Copyright (c) 2014 Mark Guinn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.