silverstripe-framework/_config/asset.yml
2016-01-13 18:18:22 +13:00

67 lines
1.8 KiB
YAML

---
Name: coreflysystem
---
Injector:
# Define the default adapter for this filesystem
FlysystemPublicAdapter:
class: 'SilverStripe\Filesystem\Flysystem\PublicAssetAdapter'
# Define the secondary adapter for protected assets
FlysystemProtectedAdapter:
class: 'SilverStripe\Filesystem\Flysystem\ProtectedAssetAdapter'
# Define the default filesystem
FlysystemPublicBackend:
class: 'League\Flysystem\Filesystem'
constructor:
Adapter: '%$FlysystemPublicAdapter'
Config:
visibility: public
# Define the secondary filesystem for protected assets
FlysystemProtectedBackend:
class: 'League\Flysystem\Filesystem'
constructor:
Adapter: '%$FlysystemProtectedAdapter'
Config:
visibility: private
---
Name: coreassets
After:
- '#coreflysystem'
---
Injector:
# Define our SS asset backend
AssetStore:
class: 'SilverStripe\Filesystem\Flysystem\FlysystemAssetStore'
properties:
PublicFilesystem: '%$FlysystemPublicBackend'
ProtectedFilesystem: '%$FlysystemProtectedBackend'
ProtectedFileController:
class: SilverStripe\Filesystem\Storage\ProtectedFileController
properties:
RouteHandler: '%$AssetStore'
AssetNameGenerator:
class: SilverStripe\Filesystem\Storage\DefaultAssetNameGenerator
type: prototype
# Requirements config
GeneratedAssetHandler:
class: SilverStripe\Filesystem\Storage\FlysystemGeneratedAssetHandler
properties:
Filesystem: '%$FlysystemPublicBackend'
Requirements_Minifier:
class: SilverStripe\View\JSMinifier
Requirements_Backend:
properties:
AssetHandler: '%$GeneratedAssetHandler'
---
Name: coreassetroutes
After:
- '#coreassets'
---
Director:
rules:
'assets': 'ProtectedFileController'
---
Name: imageconfig
---
Injector:
Image_Backend: GDBackend