silverstripe-environmentcheck/src/EnvironmentCheck.php
Robbie Averill 254ed4801f SilverStripe 4.x compatibility (#38)
* Update composer constraint for 4.x compat

* 4.x compatibility: Rename "code" to "src" and add PSR-4 autoloading

* Restructure code and tests for PSR-4

* Implement namespaces

* Implement namespaced throughout

* PSR-2 formatting updates, separate Result from CheckSuite, implement PSR-3 logging, fix tests

* FIX Routes and template location

* Update readme. Allow check classes to be namespaced or not.

* Add entry to changelog

* FIX Ensure DatabaseCheckTest always has a member. Allow strings or objects for $check in the suite

* Update readme to be clearer about passing checks with or without namespaces

* Revert namespace checking and implement Injector aliases instead. Update readme.
2017-01-05 11:16:12 +13:00

45 lines
971 B
PHP

<?php
namespace SilverStripe\EnvironmentCheck;
/**
* Interface for environment checks
*
* An environment check is a test that can be performed on a live environment. They differ from
* unit tests in that they are designed to check the state of the environment/server, rather than
* the code.
*
* Environment checks should *never* alter production data.
*
* Some things you might make environment checks for:
* - Can I access the database?
* - Are the right PHP modules installed?
* - Are the file permissions correct?
*
* @package environmentcheck
*/
interface EnvironmentCheck
{
/**
* @var int
*/
const ERROR = 3;
/**
* @var int
*/
const WARNING = 2;
/**
* @var int
*/
const OK = 1;
/**
* @return array Result with 'status' and 'message' keys.
*
* Status is EnvironmentCheck::ERROR, EnvironmentCheck::WARNING, or EnvironmentCheck::OK.
*/
public function check();
}