---
Name: assetsflysystem
---
SilverStripe\Core\Injector\Injector:
  # Define the default adapter for this filesystem
  SilverStripe\Assets\Flysystem\PublicAdapter:
    class: SilverStripe\Assets\Flysystem\PublicAssetAdapter
  # Define the secondary adapter for protected assets
  SilverStripe\Assets\Flysystem\ProtectedAdapter:
    class: SilverStripe\Assets\Flysystem\ProtectedAssetAdapter
  # Define the default filesystem
  League\Flysystem\Filesystem.public:
    class: SilverStripe\Assets\Flysystem\Filesystem
    constructor:
      FilesystemAdapter: '%$SilverStripe\Assets\Flysystem\PublicAdapter'
      FilesystemConfig:
        visibility: public
  # Define the secondary filesystem for protected assets
  League\Flysystem\Filesystem.protected:
    class: SilverStripe\Assets\Flysystem\Filesystem
    constructor:
      FilesystemAdapter: '%$SilverStripe\Assets\Flysystem\ProtectedAdapter'
      FilesystemConfig:
        visibility: private
  # Define public resolution strategy
  SilverStripe\Assets\FilenameParsing\FileResolutionStrategy.public:
    class: SilverStripe\Assets\FilenameParsing\FileIDHelperResolutionStrategy
    properties:
      ResolutionFileIDHelpers:
        - '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper'
        - '%$SilverStripe\Assets\FilenameParsing\NaturalFileIDHelper'
      DefaultFileIDHelper: '%$SilverStripe\Assets\FilenameParsing\NaturalFileIDHelper'
      VersionedStage: Live
  # Define protected resolution strategy
  SilverStripe\Assets\FilenameParsing\FileResolutionStrategy.protected:
    class: SilverStripe\Assets\FilenameParsing\FileIDHelperResolutionStrategy
    properties:
      DefaultFileIDHelper: '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper'
      ResolutionFileIDHelpers:
        - '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper'
      VersionedStage: Stage
---
Name: assetscore
---
SilverStripe\Core\Injector\Injector:
  # Define our SS asset backend
  SilverStripe\Assets\Storage\AssetStore:
    class: SilverStripe\Assets\Flysystem\FlysystemAssetStore
    properties:
      PublicFilesystem: '%$League\Flysystem\Filesystem.public'
      ProtectedFilesystem: '%$League\Flysystem\Filesystem.protected'
  SilverStripe\Assets\Storage\AssetStoreRouter: '%$SilverStripe\Assets\Storage\AssetStore'
  SilverStripe\Assets\Storage\ProtectedFileController:
    properties:
      RouteHandler: '%$SilverStripe\Assets\Storage\AssetStoreRouter'
  SilverStripe\Assets\Storage\AssetNameGenerator:
    class: SilverStripe\Assets\Storage\DefaultAssetNameGenerator
    type: prototype
  # Requirements config
  SilverStripe\Assets\Storage\GeneratedAssetHandler:
    class: SilverStripe\Assets\Flysystem\GeneratedAssets
    properties:
      Filesystem: '%$League\Flysystem\Filesystem.public'
  SilverStripe\View\Requirements_Backend:
    properties:
      AssetHandler: '%$SilverStripe\Assets\Storage\GeneratedAssetHandler'
