array( '.htaccess' => "SilverStripe\\Assets\\Flysystem\\ProtectedAssetAdapter_HTAccess" ), 'microsoft-iis' => array( 'web.config' => "SilverStripe\\Assets\\Flysystem\\ProtectedAssetAdapter_WebConfig" ) ); protected function findRoot($root) { // Use explicitly defined path if($root) { return parent::findRoot($root); } // Use environment defined path if(defined('SS_PROTECTED_ASSETS_PATH')) { return SS_PROTECTED_ASSETS_PATH; } // Default location is under assets return ASSETS_PATH . '/' . Config::inst()->get(get_class($this), 'secure_folder'); } /** * Provide secure downloadable * * @param string $path * @return string|null */ public function getProtectedUrl($path) { // Public URLs are handled via a request handler within /assets. // If assets are stored locally, then asset paths of protected files should be equivalent. return Controller::join_links(Director::baseURL(), ASSETS_DIR, $path); } }