UserFrosting API

CheckEnvironment

Performs pre-flight tests on your server environment to check that it meets the requirements.

Tags
author

Alex Weissman (https://alexanderweissman.com)

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

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
ResponseInterface

checkAll()

Run through all pre-flight checks.

public checkAll( ) : mixed
Return values
mixed

checkApache()

For Apache environments, check that required Apache modules are installed.

public checkApache( ) : mixed
Return values
mixed

checkGd()

Check for GD library (required for Captcha).

public checkGd( ) : mixed
Return values
mixed

checkImageFunctions()

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
mixed

checkPdo()

Check that PDO is installed and enabled.

public checkPdo( ) : mixed
Return values
mixed

checkDirectories()

Check that log, cache, and session directories exist.

public checkDirectories( ) : mixed
Return values
mixed

checkPermissions()

Check that log, cache, and session directories are writable, and that other directories are set appropriately for the environment.

public checkPermissions( ) : mixed
Return values
mixed

checkPhp()

Check that PHP meets the minimum required version.

public checkPhp( ) : mixed
Return values
mixed

isProduction()

Determine whether or not we are running in production mode.

public isProduction( ) : bool
Return values
bool

Search results