MediaSettingsOverride.php in Media Download 1.1.x
Same filename and directory in other branches
Namespace
Drupal\media_downloadFile
src/MediaSettingsOverride.phpView source
<?php
namespace Drupal\media_download;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
/**
* Overrides the Media module's settings to forcibly enable standalone URL.
*
* Copyright (C) 2021 Library Solutions, LLC (et al.).
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
class MediaSettingsOverride implements ConfigFactoryOverrideInterface {
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return self::CLASS;
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function loadOverrides($names) {
$overrides = [];
if (in_array('media.settings', $names)) {
$overrides['media.settings']['standalone_url'] = TRUE;
}
return $overrides;
}
}
Classes
Name![]() |
Description |
---|---|
MediaSettingsOverride | Overrides the Media module's settings to forcibly enable standalone URL. |