Requirements
in package
Class Requirements
Table of Contents
Constants
- REQUIREMENT_ERROR = 2
- Requirement severity -- Error condition; abort installation.
- REQUIREMENT_OK = 0
- Requirement severity -- Requirement successfully met.
- REQUIREMENT_WARNING = 1
- Requirement severity -- Warning condition; proceed but flag warning.
Properties
- $database_checks : mixed
- $system_checks : array<string|int, mixed>
- $system_checks_web : mixed
Methods
- checkAll() : array<string|int, mixed>
- Run all requirements tests.
- checkDatabase() : array<string|int, mixed>
- Check database connection, database version and other database requirements are met.
- checkFilepathIsWritable() : array<string|int, mixed>
- checkJsonEncodeExists() : array<string|int, mixed>
- checkMemory() : array<string|int, mixed>
- Check configured php Memory.
- checkMultibyteExists() : array<string|int, mixed>
- CHeck that PHP Multibyte functions are enabled.
- checkMySQLAutoIncrementIncrementOne() : array<string|int, mixed>
- checkMysqlConnectExists() : array<string|int, mixed>
- checkMysqlConnection() : array<string|int, mixed>
- checkMysqlInnodb() : array<string|int, mixed>
- checkMysqlLockTables() : array<string|int, mixed>
- checkMysqlTempTables() : array<string|int, mixed>
- checkMysqlThreadStack() : array<string|int, mixed>
- checkMysqlTrigger() : array<string|int, mixed>
- checkMysqlUtf8mb4() : array<string|int, mixed>
- checkMysqlVersion() : array<string|int, mixed>
- checkServerVariables() : array<string|int, mixed>
- checkSystem() : array<string|int, mixed>
- Check system requirements are met, such as sufficient memory, necessary file paths are writable and required php extensions are available.
- connect() : object
- Generates a mysql connection
- getPHPMemory() : float
- Get Configured PHP memory.
Constants
REQUIREMENT_ERROR
Requirement severity -- Error condition; abort installation.
public
mixed
REQUIREMENT_ERROR
= 2
REQUIREMENT_OK
Requirement severity -- Requirement successfully met.
public
mixed
REQUIREMENT_OK
= 0
REQUIREMENT_WARNING
Requirement severity -- Warning condition; proceed but flag warning.
public
mixed
REQUIREMENT_WARNING
= 1
Properties
$database_checks
protected
mixed
$database_checks
= ['checkMysqlConnection', 'checkMysqlVersion', 'checkMysqlInnodb', 'checkMysqlTempTables', 'checkMySQLAutoIncrementIncrementOne', 'checkMysqlTrigger', 'checkMysqlThreadStack', 'checkMysqlLockTables', 'checkMysqlUtf8mb4']
$system_checks
protected
array<string|int, mixed>
$system_checks
= ['checkMemory', 'checkMysqlConnectExists', 'checkJsonEncodeExists', 'checkMultibyteExists']
$system_checks_web
protected
mixed
$system_checks_web
= ['checkServerVariables']
Methods
checkAll()
Run all requirements tests.
public
checkAll(array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed>
-
An array with two keys:
- file_paths
- db_config
Return values
array<string|int, mixed> —An array of check summaries. Each array contains the keys 'title', 'severity', and 'details'.
checkDatabase()
Check database connection, database version and other database requirements are met.
public
checkDatabase(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
-
An array with keys:
- host (with optional port specified eg. localhost:12345)
- database (name of database to select)
- username
- password
Return values
array<string|int, mixed>checkFilepathIsWritable()
public
checkFilepathIsWritable(mixed $file_paths) : array<string|int, mixed>
Parameters
- $file_paths : mixed
Return values
array<string|int, mixed>checkJsonEncodeExists()
public
checkJsonEncodeExists() : array<string|int, mixed>
Return values
array<string|int, mixed>checkMemory()
Check configured php Memory.
public
checkMemory() : array<string|int, mixed>
Return values
array<string|int, mixed>checkMultibyteExists()
CHeck that PHP Multibyte functions are enabled.
public
checkMultibyteExists() : array<string|int, mixed>
Return values
array<string|int, mixed>checkMySQLAutoIncrementIncrementOne()
public
checkMySQLAutoIncrementIncrementOne(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
Return values
array<string|int, mixed>checkMysqlConnectExists()
public
checkMysqlConnectExists() : array<string|int, mixed>
Return values
array<string|int, mixed>checkMysqlConnection()
public
checkMysqlConnection(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
Return values
array<string|int, mixed>checkMysqlInnodb()
public
checkMysqlInnodb(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
Return values
array<string|int, mixed>checkMysqlLockTables()
public
checkMysqlLockTables(mixed $db_config) : array<string|int, mixed>
Parameters
- $db_config : mixed
Return values
array<string|int, mixed>checkMysqlTempTables()
public
checkMysqlTempTables(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
Return values
array<string|int, mixed>checkMysqlThreadStack()
public
checkMysqlThreadStack(mixed $db_config) : array<string|int, mixed>
Parameters
- $db_config : mixed
Return values
array<string|int, mixed>checkMysqlTrigger()
public
checkMysqlTrigger(mixed $db_config) : array<string|int, mixed>
Parameters
- $db_config : mixed
Return values
array<string|int, mixed>checkMysqlUtf8mb4()
public
checkMysqlUtf8mb4(mixed $db_config) : array<string|int, mixed>
Parameters
- $db_config : mixed
Return values
array<string|int, mixed>checkMysqlVersion()
public
checkMysqlVersion(array<string|int, mixed> $db_config) : array<string|int, mixed>
Parameters
- $db_config : array<string|int, mixed>
Return values
array<string|int, mixed>checkServerVariables()
public
checkServerVariables() : array<string|int, mixed>
Return values
array<string|int, mixed>checkSystem()
Check system requirements are met, such as sufficient memory, necessary file paths are writable and required php extensions are available.
public
checkSystem(array<string|int, mixed> $file_paths) : array<string|int, mixed>
Parameters
- $file_paths : array<string|int, mixed>
-
An array of file paths that will be checked to confirm they are writable.
Return values
array<string|int, mixed>connect()
Generates a mysql connection
protected
connect(array<string|int, mixed> $db_config) : object
Parameters
- $db_config : array<string|int, mixed>
Return values
object —mysqli connection
getPHPMemory()
Get Configured PHP memory.
protected
getPHPMemory() : float