\Installer\UtilityServerTest

Used to test if server meets all requirements to install QuickAppsCMS.

Summary

Methods
Properties
Constants
__construct()
errors()
add()
No public properties found
No constants found
No protected methods found
$_rules
$_useI18n
N/A
No private methods found
No private properties found
N/A

Properties

$_rules

$_rules : array

Rules to be checked.

Type

array

$_useI18n

$_useI18n : boolean

Whether or not to use I18n functions for translating default error messages.

Type

boolean

Methods

__construct()

__construct()

Constructor

errors()

errors() : array

Returns an array of fields that have failed validation. On the current model.

This method will actually run validation rules over data, not just return the messages.

Returns

array

add()

add(string $name, array|callable|boolean $rule, string|null $message) : $this

Adds a new test to run later using "errors()".

Usage:

$tests = new ServerTest();
$test->add('php_version',
    version_compare(PHP_VERSION, '5.4.19', '>='),
    'PHP version must be >= 5.4.19'
);
$tests = new ServerTest();
$test->add('php_version', [
    'rule' => function () {
        return version_compare(PHP_VERSION, '5.4.19', '>=');
    },
    'message' => 'PHP version must be >= 5.4.19',
]);
$tests = new ServerTest();
$test->add('php_version',
    function () {
        return version_compare(PHP_VERSION, '5.4.19', '>=');
    },
    'PHP version must be >= 5.4.19'
);

Parameters

string $name

Name of the test

array|callable|boolean $rule

If an array, keys rule and message are required. If a callable is given, it should return boolean.

string|null $message

Message to show on test failure

Returns

$this