silverstripe-framework/_config/asset.yml

75 lines
2.1 KiB
YAML
Raw Normal View History

---
Name: coreflysystem
---
SilverStripe\Core\Injector\Injector:
# Define the default adapter for this filesystem
FlysystemPublicAdapter:
class: 'SilverStripe\Assets\Flysystem\PublicAssetAdapter'
# Define the secondary adapter for protected assets
FlysystemProtectedAdapter:
class: 'SilverStripe\Assets\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'
---
SilverStripe\Core\Injector\Injector:
# Define our SS asset backend
AssetStore:
class: 'SilverStripe\Assets\Flysystem\FlysystemAssetStore'
properties:
PublicFilesystem: '%$FlysystemPublicBackend'
ProtectedFilesystem: '%$FlysystemProtectedBackend'
ProtectedFileController:
class: SilverStripe\Assets\Storage\ProtectedFileController
properties:
RouteHandler: '%$AssetStore'
AssetNameGenerator:
class: SilverStripe\Assets\Storage\DefaultAssetNameGenerator
type: prototype
# Requirements config
GeneratedAssetHandler:
class: SilverStripe\Assets\Flysystem\GeneratedAssetHandler
properties:
Filesystem: '%$FlysystemPublicBackend'
SilverStripe\View\Requirements_Minifier:
class: SilverStripe\View\JSMinifier
SilverStripe\View\Requirements_Backend:
properties:
AssetHandler: '%$GeneratedAssetHandler'
---
Name: coreassetroutes
After:
- '#coreassets'
---
SilverStripe\Control\Director:
rules:
'assets': ProtectedFileController
---
Name: imageconfig
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Assets\Image_Backend:
class: SilverStripe\Assets\GDBackend
Image_Backend: '%$SilverStripe\Assets\Image_Backend'
---
Name: coreassetfield
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Forms\FileHandleField:
class: SilverStripe\Forms\FileField