PHP Class Horde_Test, horde

$Horde: horde/lib/Test.php,v 1.21 2004/02/14 02:40:35 chuck Exp $ Copyright 1999-2004 Charles J. Hagenbuch Copyright 1999-2004 Jon Parise Copyright 2002-2004 Brent J. Nordquist Copyright 2003-2004 Michael Slusarz See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Author: Brent J. Nordquist ([email protected])
Author: Michael Slusarz ([email protected])
显示文件 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_appList array
KEY:   app name
VALUE: An array with the following entries:
       error: (string) Error message.
       version: (string) Minimum version required of the app.
$_fileList array
KEY:   file path
VALUE: The error message to use (null to use default message)
$_moduleList array If function returns a string, this error message will be used. phpver: (string) The PHP version above which to do the test
$_pearList array
KEY:   PEAR class name
VALUE: An array with the following entries:
       depends: (?) This module depends on another module.
       error: (string) Error message.
       function: (string) Reference to function to run if module is
                 found.
       path: (string) The path to the PEAR module. Only needed if
                KEY is not autoloadable.
       required: (boolean) Is this PEAR module required?
$_phpver array The PHP version of the system.
$_settingsList array
KEY:   setting name
VALUE: An array with the following entries:
       error: (string) Error message.
       function: (string) Reference to function to run. If function
                 returns non-empty value, error message will be output.
       setting: (mixed) Either a boolean (whether setting should be
                on or off) or 'value', which will simply output the
                value of the setting.
$_supported array Supported versions of PHP.

Public Methods

Method Description
__construct ( ) Constructor.
appTests ( ) : string Any application specific tests that need to be done.
getPhpVersionInformation ( ) : object Obtain information on the PHP version.
pearModuleCheck ( ) : string Check the list of PEAR modules.
phpModuleCheck ( ) : string Check the list of PHP modules.
phpSettingCheck ( $settings = null ) : string Checks the list of PHP settings.
requiredAppCheck ( ) : string Check the list of required Horde applications.
requiredFileCheck ( ) : string Check the list of required files

Protected Methods

Method Description
_checkFileinfo ( ) : boolean Additional check for fileinfo module.
_checkGcDivisor ( ) : boolean Additional check for 'session.gc_divisor'.
_checkGcProbability ( ) : boolean Additional check for 'session.gc_probability'.
_checkIconvImplementation ( ) : boolean Additional check for iconv module implementation.
_checkLibxmlVersion ( ) : boolean Additional check for libxml version.
_checkMemoryLimit ( ) : boolean Additional check for 'session.gc_divisor'.
_checkMongo ( )
_checkPam ( )
_outputLine ( array $entry ) : string Internal output function.
_requiredFileCheck ( array $filelist, string $php, boolean $is_local = false ) : string Check the list of required files
_splitPhpVersion ( string $version ) Parse PHP version.
_status ( boolean $bool, boolean $required = true ) : string Output the results of a status check.

Method Details

__construct() public method

Constructor.
public __construct ( )

_checkFileinfo() protected method

Additional check for fileinfo module.
protected _checkFileinfo ( ) : boolean
return boolean False on error.

_checkGcDivisor() protected method

Additional check for 'session.gc_divisor'.
protected _checkGcDivisor ( ) : boolean
return boolean Returns true if error string should be displayed.

_checkGcProbability() protected method

Additional check for 'session.gc_probability'.
protected _checkGcProbability ( ) : boolean
return boolean Returns true if error string should be displayed.

_checkIconvImplementation() protected method

Additional check for iconv module implementation.
protected _checkIconvImplementation ( ) : boolean
return boolean False on error.

_checkLibxmlVersion() protected method

Additional check for libxml version.
protected _checkLibxmlVersion ( ) : boolean
return boolean False on error.

_checkMemoryLimit() protected method

Additional check for 'session.gc_divisor'.
protected _checkMemoryLimit ( ) : boolean
return boolean Returns true if error string should be displayed.

_checkMongo() protected method

protected _checkMongo ( )

_checkPam() protected method

protected _checkPam ( )

_outputLine() protected method

Internal output function.
protected _outputLine ( array $entry ) : string
$entry array Array with the following values:
1st value: Header
2nd value: Test Result
3rd value: Error message (if present)
4th value: Error level (if present): 0 = error, 1 = warning
return string HTML output.

_requiredFileCheck() protected method

Check the list of required files
protected _requiredFileCheck ( array $filelist, string $php, boolean $is_local = false ) : string
$filelist array List of files to check.
$php string PHP CLI location.
$is_local boolean Is filelist a "local" file?
return string The HTML output.

_splitPhpVersion() protected method

Parse PHP version.
protected _splitPhpVersion ( string $version )
$version string A PHP-style version string (X.X.X).

_status() protected method

Output the results of a status check.
protected _status ( boolean $bool, boolean $required = true ) : string
$bool boolean The result of the status check.
$required boolean Whether the checked item is required.
return string The HTML of the result of the status check.

appTests() public method

Any application specific tests that need to be done.
public appTests ( ) : string
return string HTML output.

getPhpVersionInformation() public method

Obtain information on the PHP version.
public getPhpVersionInformation ( ) : object
return object stdClass TODO

pearModuleCheck() public method

Check the list of PEAR modules.
public pearModuleCheck ( ) : string
return string The HTML output.

phpModuleCheck() public method

Check the list of PHP modules.
public phpModuleCheck ( ) : string
return string The HTML output.

phpSettingCheck() public method

Checks the list of PHP settings.
public phpSettingCheck ( $settings = null ) : string
return string The HTML output.

requiredAppCheck() public method

Check the list of required Horde applications.
public requiredAppCheck ( ) : string
return string The HTML output.

requiredFileCheck() public method

Check the list of required files
public requiredFileCheck ( ) : string
return string The HTML output.

Property Details

$_appList protected_oe property

KEY:   app name
VALUE: An array with the following entries:
       error: (string) Error message.
       version: (string) Minimum version required of the app.
protected array $_appList
return array

$_fileList protected_oe property

KEY:   file path
VALUE: The error message to use (null to use default message)
protected array $_fileList
return array

$_moduleList protected_oe property

If function returns a string, this error message will be used. phpver: (string) The PHP version above which to do the test
protected array $_moduleList
return array

$_pearList protected_oe property

KEY:   PEAR class name
VALUE: An array with the following entries:
       depends: (?) This module depends on another module.
       error: (string) Error message.
       function: (string) Reference to function to run if module is
                 found.
       path: (string) The path to the PEAR module. Only needed if
                KEY is not autoloadable.
       required: (boolean) Is this PEAR module required?
protected array $_pearList
return array

$_phpver protected_oe property

The PHP version of the system.
protected array $_phpver
return array

$_settingsList protected_oe property

KEY:   setting name
VALUE: An array with the following entries:
       error: (string) Error message.
       function: (string) Reference to function to run. If function
                 returns non-empty value, error message will be output.
       setting: (mixed) Either a boolean (whether setting should be
                on or off) or 'value', which will simply output the
                value of the setting.
protected array $_settingsList
return array

$_supported protected_oe property

Supported versions of PHP.
protected array $_supported
return array