You are here

public function MimeMapManager::requirements in Sophron 8

Check installation requirements and do status reporting.

Parameters

string $phase: The phase in which requirements are checked.

Return value

array An associative array of requirements.

Overrides MimeMapManagerInterface::requirements

File

src/MimeMapManager.php, line 187

Class

MimeMapManager
Provides a sensible mapping between filename extensions and MIME types.

Namespace

Drupal\sophron

Code

public function requirements($phase) {
  $is_sophron_guessing = $this->moduleHandler
    ->moduleExists('sophron_guesser');
  return [
    'mime_type_guessing_sophron' => [
      'title' => $this
        ->t('MIME type guessing'),
      'value' => $is_sophron_guessing ? $this
        ->t('Sophron') : $this
        ->t('Drupal core'),
      'description' => $is_sophron_guessing ? $this
        ->t('The <strong>Sophron guesser</strong> module is providing MIME type guessing. <a href=":url">Uninstall the module</a> to revert to Drupal core guessing.', [
        ':url' => Url::fromRoute('system.modules_uninstall')
          ->toString(),
      ]) : $this
        ->t('Drupal core is providing MIME type guessing. <a href=":url">Install the <strong>Sophron guesser</strong> module</a> to allow the enhanced guessing provided by Sophron.', [
        ':url' => Url::fromRoute('system.modules_list')
          ->toString(),
      ]),
    ],
  ];
}