Class cSystemtest
Provides functions to test the system integrity
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Mischa Holz
Located at classes/class.systemtest.php
public
|
|
public
|
|
public
|
#
storeResult( boolean $result, integer $severity, string $errorHeadline = "", string $errorMessage = "", string $successHeadline = "", string $successMessage = "" )
Stores a result in the messages array for later display |
public
array
|
|
protected
boolean
|
#
getFileInfo( string $sFilename )
Returns an array with information about the file, especially the file owner |
protected
boolean
|
|
protected
boolean
|
#
canWriteDir( string $dirname )
Returns true if the given file is a directory and if it is writeable |
protected
number
|
|
protected
number
|
|
protected
integer
|
#
predictCorrectFilepermissions( string $file )
Returns one of the CON_PREDICT suggestions depending on the permissions of the given file |
protected
mixed
|
|
protected
number
|
|
protected
boolean
|
#
doMySQLConnect( string $host, string $username, string $password )
Connects to the database with the given settings |
public
integer
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
integer
|
|
public
boolean
|
|
protected
boolean
|
#
testSingleFile( string $filename, integer $severity, boolean $dir = false )
Checks a single file or directory wether it is writeable or not |
public
boolean
|
|
public
integer
|
#
checkOpenBasedirCompatibility( )
Checks for the open_basedir directive and returns one of the CON_BASEDIR constants |
public
integer
|
|
public
|
string |
CON_SETUP_MIN_PHP_VERSION
|
'5.2.3' |
#
The minimal PHP version |
integer |
C_SEVERITY_NONE
|
1 |
#
Messages have no influence on the result of the system integrity |
integer |
C_SEVERITY_INFO
|
2 |
#
Messages are only to inform the user about something. |
integer |
C_SEVERITY_WARNING
|
3 |
#
Messages about settings which aren't correct, but CONTENIDO might work anyway |
integer |
C_SEVERITY_ERROR
|
4 |
#
Messages about settings which aren't correct. CONTENIDO won't work |
integer |
CON_PREDICT_SUFFICIENT
|
1 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are okay |
integer |
CON_PREDICT_NOTPREDICTABLE
|
2 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are not predictable (we can't figure the server UID) |
integer |
CON_PREDICT_CHANGEPERM_SAMEOWNER
|
3 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the owner have to be changed |
integer |
CON_PREDICT_CHANGEPERM_SAMEGROUP
|
4 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the group have to be changed |
integer |
CON_PREDICT_CHANGEPERM_OTHERS
|
5 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for others should be changed |
integer |
CON_PREDICT_CHANGEUSER
|
6 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The owner of the file should be changed |
integer |
CON_PREDICT_CHANGEGROUP
|
7 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The group of the file should be changed |
integer |
CON_PREDICT_WINDOWS
|
8 |
#
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are unpredictable because Windows |
integer |
CON_BASEDIR_NORESTRICTION
|
1 |
#
Possible result of cSystemtest::checkOpenBaseDir(). No restrictions |
integer |
CON_BASEDIR_DOTRESTRICTION
|
2 |
#
Possible result of cSystemtest::checkOpenBaseDir(). The Basedir is set to ".". CONTENIDO won't work |
integer |
CON_BASEDIR_RESTRICTIONSUFFICIENT
|
3 |
#
Possible result of cSystemtest::checkOpenBaseDir(). Open basedir is in effect but CONTENIDO works anyway |
integer |
CON_BASEDIR_INCOMPATIBLE
|
4 |
#
Possible result of cSystemtest::checkOpenBaseDir(). Open basedir is in effect and CONTENIDO doesn't work with it |
integer |
CON_EXTENSION_AVAILABLE
|
1 |
#
Possible result of cSystemtest::isPHPExtensionLoaded() The extension is loaded |
integer |
CON_EXTENSION_UNAVAILABLE
|
2 |
#
Possible result of cSystemtest::isPHPExtensionLoaded() The extension is not loaded |
integer |
CON_EXTENSION_CANTCHECK
|
3 |
#
Possible result of cSystemtest::isPHPExtensionLoaded() It was unable to check wether the extension is loaded or not |
integer |
CON_IMAGERESIZE_GD
|
1 |
#
Possible result of cSystemtest::checkImageResizer() GD is available for image resizing |
integer |
CON_IMAGERESIZE_IMAGEMAGICK
|
2 |
#
Possible result of cSystemtest::checkImageResizer() ImageMagick is available for image resizing |
integer |
CON_IMAGERESIZE_CANTCHECK
|
3 |
#
Possible result of cSystemtest::checkImageResizer() It was unable to check which extension is available for image resizing |
integer |
CON_IMAGERESIZE_NOTHINGAVAILABLE
|
4 |
#
Possible result of cSystemtest::checkImageResizer() No fitting extension is available |
integer |
CON_MYSQL_OK
|
1 |
#
Possible result of cSystemtest::testMySQL() Everything works fine with the given settings |
integer |
CON_MYSQL_STRICT_MODE
|
2 |
#
Possible result of cSystemtest::testMySQL() Strict mode is activated. CONTENIDO won't work |
integer |
CON_MYSQL_CANT_CONNECT
|
3 |
#
Possible result of cSystemtest::testMySQL() Strict mode is activated. CONTENIDO won't work |
protected
array
|
$_messages |
|
#
The test results which are stored for display. Every array element is an assoicative array like this: $_messages[$i] = array( "result" => $result, //true or false, success or no success "severity" => $severity, //one of the C_SEVERITY constants "headline" => $headline, //the headline of the message "message" => $message //the message ); |
protected
array
|
$_config |
|
#
The stored config array |