SilverStripe\EnvironmentCheck\EnvironmentCheckSuite
Represents a suite of environment checks.
Specific checks can be registered against a named instance of EnvironmentCheckSuite.
Usage #1 - _config.php
EnvironmentCheckSuite::register('health', 'MyHealthCheck("my param")', 'Title of my health check');
Usage #2 - config.yml
EnvironmentCheckSuite:
registered_checks:
mycheck:
definition: 'MyHealthCheck("my param")'
title: 'Title of my health check'
registered_suites:
health:
- mycheck
$result = EnvironmentCheckSuite::inst('health')->run();
Synopsis
class EnvironmentCheckSuite
{
- // members
- protected $name;
- protected array $checks = ;
- private static array $registered_checks = ;
- private static array $registered_suites = ;
- protected static array $instances = ;
- // methods
- public void __construct()
- public EnvironmentCheckSuiteResult run()
- protected array checkInstances()
- public void push()
- public static EnvironmentCheckSuite inst()
- public static void register()
- public static void reset()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Extensible
Members
private
- $registered_checks
—
array
Associative array of named checks registered via the config system. Each check should specify: - definition (e.g. 'MyHealthCheck("my param")') - title (e.g. 'Is my feature working?') - state (setting this to 'disabled' will cause suites to skip this check entirely. - $registered_suites
—
array
Associative array of named suites registered via the config system. Each suite should enumerate named checks that have been configured in 'registered_checks'.
protected
- $checks — array
- $instances — array
- $name
—
string
Name of this suite.
Methods
protected
- checkInstances() — Get instances of all the environment checks.
public
- __construct() — Load checks for this suite from the configuration system. This is an alternative to the EnvironmentCheckSuite::register - both can be used, checks will be appended to the suite.
- inst() — Return a named instance of EnvironmentCheckSuite.
- push() — Add a check to this suite.
- register() — Register a check against the named check suite.
- reset() — Unregisters all checks.
- run() — Run this test suite and return the result code of the worst result.