ModulesBase.php in Production check & Production monitor 8
File
src/Plugin/ProdCheck/Modules/ModulesBase.php
View source
<?php
namespace Drupal\prod_check\Plugin\ProdCheck\Modules;
use Drupal\prod_check\Plugin\ProdCheck\ProdCheckBase;
abstract class ModulesBase extends ProdCheckBase {
protected $module = '';
protected $routeName = '';
public function state() {
return !$this->moduleHandler
->moduleExists($this->module);
}
public function successMessages() {
return [
'value' => $this
->t('Disabled'),
'description' => $this
->t('Your settings are OK for production use.'),
];
}
public function failMessages() {
return [
'value' => $this
->t('Enabled'),
'description' => $this
->generateDescription($this
->title(), $this->routeName, 'You have enabled the %link module. This should not be running on a production environment!'),
];
}
}