2012-01-10 07:28:04 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for environment checks
|
|
|
|
*
|
2015-09-10 23:13:48 +02:00
|
|
|
* 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.
|
2012-01-10 07:28:04 +01:00
|
|
|
*
|
|
|
|
* 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?
|
|
|
|
*/
|
|
|
|
interface EnvironmentCheck {
|
2015-09-10 23:13:48 +02:00
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
2012-01-10 07:28:04 +01:00
|
|
|
const ERROR = 3;
|
2015-09-10 23:13:48 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
2012-01-10 07:28:04 +01:00
|
|
|
const WARNING = 2;
|
2015-09-10 23:13:48 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
2012-01-10 07:28:04 +01:00
|
|
|
const OK = 1;
|
|
|
|
|
|
|
|
/**
|
2015-09-10 23:13:48 +02:00
|
|
|
* @return array Result with 'status' and 'message' keys.
|
|
|
|
*
|
|
|
|
* Status is EnvironmentCheck::ERROR, EnvironmentCheck::WARNING, or EnvironmentCheck::OK.
|
2012-01-10 07:28:04 +01:00
|
|
|
*/
|
|
|
|
function check();
|
|
|
|
}
|