CheckEnvironment
Performs pre-flight tests on your server environment to check that it meets the requirements.
Tags
Table of Contents
$locator | ResourceLocator | |
---|---|---|
$resultsFailed | array | |
$resultsSuccess | array | |
$view | Twig | |
$cache | CacheManager | |
__construct() | Constructor. | mixed |
__invoke() | Invoke the CheckEnvironment middleware, performing all pre-flight checks and returning an error page if problems were found. | ResponseInterface |
checkAll() | Run through all pre-flight checks. | mixed |
checkApache() | For Apache environments, check that required Apache modules are installed. | mixed |
checkGd() | Check for GD library (required for Captcha). | mixed |
checkImageFunctions() | Check that all image* functions used by Captcha exist. | mixed |
checkPdo() | Check that PDO is installed and enabled. | mixed |
checkDirectories() | Check that log, cache, and session directories exist. | mixed |
checkPermissions() | Check that log, cache, and session directories are writable, and that other directories are set appropriately for the environment. | mixed |
checkPhp() | Check that PHP meets the minimum required version. | mixed |
isProduction() | Determine whether or not we are running in production mode. | bool |
Properties
$locator
protected
ResourceLocator
$locator
$resultsFailed
protected
array
$resultsFailed
= []
$resultsSuccess
protected
array
$resultsSuccess
= []
$view
protected
Twig
$view
$cache
protected
CacheManager
$cache
Methods
__construct()
Constructor.
public
__construct(
$view :
Twig
, $locator :
ResourceLocator
, $cache :
CacheManager
)
: mixed
Parameters
- $view : Twig
The view object, needed for rendering error page.
- $locator : ResourceLocator
Locator service for stream resources.
- $cache : CacheManager
Cache manager
Return values
mixed__invoke()
Invoke the CheckEnvironment middleware, performing all pre-flight checks and returning an error page if problems were found.
public
__invoke(
$request :
ServerRequestInterface
, $response :
ResponseInterface
, $next :
callable
)
: ResponseInterface
Parameters
- $request : ServerRequestInterface
PSR7 request
- $response : ResponseInterface
PSR7 response
- $next : callable
Next middleware
Return values
ResponseInterfacecheckAll()
Run through all pre-flight checks.
public
checkAll(
)
: mixed
Return values
mixedcheckApache()
For Apache environments, check that required Apache modules are installed.
public
checkApache(
)
: mixed
Return values
mixedcheckGd()
Check for GD library (required for Captcha).
public
checkGd(
)
: mixed
Return values
mixedcheckImageFunctions()
Check that all image* functions used by Captcha exist.
public
checkImageFunctions(
)
: mixed
Some versions of GD are missing one or more of these functions, thus why we check for them explicitly.
Return values
mixedcheckPdo()
Check that PDO is installed and enabled.
public
checkPdo(
)
: mixed
Return values
mixedcheckDirectories()
Check that log, cache, and session directories exist.
public
checkDirectories(
)
: mixed
Return values
mixedcheckPermissions()
Check that log, cache, and session directories are writable, and that other directories are set appropriately for the environment.
public
checkPermissions(
)
: mixed
Return values
mixedcheckPhp()
Check that PHP meets the minimum required version.
public
checkPhp(
)
: mixed
Return values
mixedisProduction()
Determine whether or not we are running in production mode.
public
isProduction(
)
: bool