PHPackages                             markguinn/silverstripe-cloudassets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. markguinn/silverstripe-cloudassets

ActiveSilverstripe-module

markguinn/silverstripe-cloudassets
==================================

Allows some or all of the assets folder to be located in a cloud storage container (CloudFiles, etc.)

1.1.0(11y ago)199.2k9[12 issues](https://github.com/markguinn/silverstripe-cloudassets/issues)[1 PRs](https://github.com/markguinn/silverstripe-cloudassets/pulls)2MITPHP

Since Mar 3Pushed 7y ago7 watchersCompare

[ Source](https://github.com/markguinn/silverstripe-cloudassets)[ Packagist](https://packagist.org/packages/markguinn/silverstripe-cloudassets)[ RSS](/packages/markguinn-silverstripe-cloudassets/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (2)

Cloud Assets Module
===================

[](#cloud-assets-module)

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.

Versions: [![Latest Stable Version](https://camo.githubusercontent.com/e1f0f38488bc2a43f16cb9f8f97e509e2398e17feac10039a08990c764f96daa/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732f762f737461626c652e706e67)](https://packagist.org/packages/markguinn/silverstripe-cloudassets)[![Latest Unstable Version](https://camo.githubusercontent.com/1c81d40d473281579239fbe7a6a3d91722f965f10b83eb751c23cc046006bcfe/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732f762f756e737461626c652e706e67)](https://packagist.org/packages/markguinn/silverstripe-cloudassets)

Licence: [![License](https://camo.githubusercontent.com/2f005992c3a71fefc918a8bbbc1c2eb6d56d93c2208bacc5dbef0406fce250ca/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732f6c6963656e73652e706e67)](https://packagist.org/packages/markguinn/silverstripe-cloudassets)

Quality: [![Build Status](https://camo.githubusercontent.com/4d02432570cc4115964a256fa21e6278ed6587f18453880d2474b817d18e7cb9/68747470733a2f2f7472617669732d63692e6f72672f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/markguinn/silverstripe-cloudassets)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/ed11a63ea85fd65bded6ee85c2358cb4ee46a59d6334b7bf9e6573ab69cbb763/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732f6261646765732f7175616c6974792d73636f72652e706e673f733d35303665623430613231393738383039383066663166363935626465356665373961346637343432)](https://scrutinizer-ci.com/g/markguinn/silverstripe-cloudassets/)[![codecov.io](https://camo.githubusercontent.com/5284a837d566878e83cc99467821d6f531531269a922f45092a2411694814a85/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d61726b6775696e6e2f73696c7665727374726970652d636c6f75646173736574732f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/markguinn/silverstripe-cloudassets?branch=master)

Support: [!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/markguinn/silverstripe-cloudassets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Requirements
------------

[](#requirements)

- Silverstripe 3.1+ (tested against 3.1 and master)
- Not very useful without a bucket driver such as:
    - Rackspace CloudFiles:
    - Amazon S3:
    - (please let me know if anyone has written others)

Example
-------

[](#example)

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.

How It Works
------------

[](#how-it-works)

1. CloudFileExtension is added to File.
2. In onAfterWrite, this extension checks if anything needs to be synced to the cloud or changed to a wrapped class.
3. File and Image records are converted at that stage to the corresponding wrapped versions. Additional wrapper classes can be added (if you have other subclasses of File) via `CloudAssets.wrappers`. Note that any subclass that is not wrapped will continue to function normally and will not use the cloud.
4. Once wrapped, the file length will be checked every onAfterWrite. If the file on disk has been replaced it will be uploaded to the cloud storage and the local version truncated to the string 'CloudFile' (see `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.
5. For files (image, etc) the wrapped class overrides Link, URL, etc to point to the CDN version of the file.

This setup allows you to forgo mounting the cloud storage via s3fs, CloudFuse, etc but shouldn't require changes to the Silverstripe file subsystem.

Scenarios Where This Won't Work
-------------------------------

[](#scenarios-where-this-wont-work)

- Hosting with no writable storage. The assets folder does not need to be permanent but it does need to be used. Per-request permanence should be enough, though maybe not ideal.

Developer(s)
------------

[](#developers)

- Mark Guinn

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.

License (MIT)
-------------

[](#license-mit)

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.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~114 days

Total

3

Last Release

4227d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/485dfc9fc93cad085c83c3276f19b6e9322ee910ab0e1685de0db42228dbf97b?d=identicon)[markguinn](/maintainers/markguinn)

---

Top Contributors

[![gordonbanderson](https://avatars.githubusercontent.com/u/7060?v=4)](https://github.com/gordonbanderson "gordonbanderson (3 commits)")[![markguinn](https://avatars.githubusercontent.com/u/495837?v=4)](https://github.com/markguinn "markguinn (2 commits)")[![obj63mc](https://avatars.githubusercontent.com/u/443120?v=4)](https://github.com/obj63mc "obj63mc (2 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![simonwelsh](https://avatars.githubusercontent.com/u/125915?v=4)](https://github.com/simonwelsh "simonwelsh (1 commits)")

---

Tags

silverstripeassetscdnrackspacecloud-storagecloudfiles

### Embed Badge

![Health badge](/badges/markguinn-silverstripe-cloudassets/health.svg)

```
[![Health](https://phpackages.com/badges/markguinn-silverstripe-cloudassets/health.svg)](https://phpackages.com/packages/markguinn-silverstripe-cloudassets)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[silverstripe/admin

SilverStripe admin interface

262.6M325](/packages/silverstripe-admin)[unclecheese/silverstripe-kickassets

Provides an alternative file management interface for SilverStripe CMS with drag-and-drop, multi-selection, and several other desktop-like UI conventions.

4728.3k1](/packages/unclecheese-silverstripe-kickassets)[silverstripe/secureassets

Adds access restrictions to folders in assets, similar to the way you secure pages

17157.0k5](/packages/silverstripe-secureassets)[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)[silverleague/ideannotator

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

4768.0k43](/packages/silverleague-ideannotator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
