You are here

public function DiagnosticCheckInterface::run in Purge 8.3

Perform the check and determine the severity level.

Diagnostic checks determine whether something you are checking for is in shape, for instance CMI settings on which your plugin depends. Any check reporting self::SEVERITY_ERROR in their run() methods, will cause purge to stop working. Any other severity level will let the purgers proceed operating but you may report any warning through getRecommendation() to be shown on Drupal's status report, purge_ui or any other diagnostic listing.


public function run() {
  if (...check..) {
    return self::SEVERITY_OK;
  }
  return self::SEVERITY_WARNING;
}

@warning As diagnostic checks can be expensive, this method is called as rarely as possible. Checks derived from DiagnosticCheckBase will only see the check getting executed when any of the getter methods are called.

Return value

int Integer, matching either of the following constants:

Throws

\Drupal\purge\Plugin\Purge\DiagnosticCheck\Exception\CheckNotImplementedCorrectly Thrown when the return value is incorrect.

1 call to DiagnosticCheckInterface::run()
DiagnosticCheckBase::runCheck in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Late runtime helper to assure that ::run() got called (and only once).
14 methods override DiagnosticCheckInterface::run()
AlwaysErrorDiagnosticCheck::run in tests/modules/purge_check_error_test/src/Plugin/Purge/DiagnosticCheck/AlwaysErrorDiagnosticCheck.php
Perform the check and determine the severity level.
AlwaysInfoDiagnosticCheck::run in tests/modules/purge_check_test/src/Plugin/Purge/DiagnosticCheck/AlwaysInfoDiagnosticCheck.php
Perform the check and determine the severity level.
AlwaysOkDiagnosticCheck::run in tests/modules/purge_check_test/src/Plugin/Purge/DiagnosticCheck/AlwaysOkDiagnosticCheck.php
Perform the check and determine the severity level.
AlwaysWarningDiagnosticCheck::run in tests/modules/purge_check_warning_test/src/Plugin/Purge/DiagnosticCheck/AlwaysWarningDiagnosticCheck.php
Perform the check and determine the severity level.
CapacityDiagnosticCheck::run in src/Plugin/Purge/DiagnosticCheck/CapacityDiagnosticCheck.php
Perform the check and determine the severity level.

... See full list

File

src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckInterface.php, line 67

Class

DiagnosticCheckInterface
Describes a diagnostic check that checks a specific purging requirement.

Namespace

Drupal\purge\Plugin\Purge\DiagnosticCheck

Code

public function run();