You are here

protected function CdnServiceProvider::cdnStatusIsEnabled in CDN 8.3

Return value

bool

1 call to CdnServiceProvider::cdnStatusIsEnabled()
CdnServiceProvider::register in src/CdnServiceProvider.php
Registers services to the container.

File

src/CdnServiceProvider.php, line 43

Class

CdnServiceProvider

Namespace

Drupal\cdn

Code

protected function cdnStatusIsEnabled() : bool {
  $cdn_settings = BootstrapConfigStorageFactory::get()
    ->read('cdn.settings');

  // In Kernel tests it's possible this code is called before cdn.settings
  // exists. In such cases behave as though the CDN status is "disabled". This
  // is also the default value in cdn.settings.yml.
  if ($cdn_settings === FALSE) {
    return FALSE;
  }
  return $cdn_settings['status'] === TRUE;
}