Documentation

PhpIniRequirement extends Requirement
in package

Represents a PHP requirement in form of a php.ini configuration.

Tags
author

Tobias Schultze http://tobion.de

Table of Contents

Properties

$fulfilled  : mixed
$helpHtml  : mixed
$helpText  : mixed
$optional  : mixed
$testMessage  : mixed

Methods

__construct()  : mixed
Constructor that initializes the requirement.
getHelpHtml()  : string
Returns the help text formatted in HTML.
getHelpText()  : string
Returns the help text for resolving the problem.
getTestMessage()  : string
Returns the message for testing the requirement.
isFulfilled()  : bool
Returns whether the requirement is fulfilled.
isOptional()  : bool
Returns whether this is only an optional recommendation and not a mandatory requirement.

Properties

Methods

__construct()

Constructor that initializes the requirement.

public __construct(string $cfgName, bool|callable $evaluation[, bool $approveCfgAbsence = false ][, string|null $testMessage = null ][, string|null $helpHtml = null ][, string|null $helpText = null ][, bool $optional = false ]) : mixed
Parameters
$cfgName : string

The configuration name used for ini_get()

$evaluation : bool|callable

Either a boolean indicating whether the configuration should evaluate to true or false, or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement

$approveCfgAbsence : bool = false

If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.

$testMessage : string|null = null

The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)

$helpHtml : string|null = null

The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)

$helpText : string|null = null

The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

$optional : bool = false

Whether this is only an optional recommendation not a mandatory requirement

getHelpHtml()

Returns the help text formatted in HTML.

public getHelpHtml() : string
Return values
string

The HTML help

getHelpText()

Returns the help text for resolving the problem.

public getHelpText() : string
Return values
string

The help text

getTestMessage()

Returns the message for testing the requirement.

public getTestMessage() : string
Return values
string

The test message

isFulfilled()

Returns whether the requirement is fulfilled.

public isFulfilled() : bool
Return values
bool

true if fulfilled, otherwise false

isOptional()

Returns whether this is only an optional recommendation and not a mandatory requirement.

public isOptional() : bool
Return values
bool

true if optional, false if mandatory


        
On this page

Search results