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
|
#
checkSetupMysql( string $setupType, string $databaseName, string $databasePrefix, $charset = '', $collation = '' )
|
string |
CON_SETUP_MIN_PHP_VERSION
The minimal PHP version |
#
'5.3'
|
integer |
C_SEVERITY_NONE
Messages have no influence on the result of the system integrity |
#
1
|
integer |
C_SEVERITY_INFO
Messages are only to inform the user about something. |
#
2
|
integer |
C_SEVERITY_WARNING
Messages about settings which aren't correct, but CONTENIDO might work anyway |
#
3
|
integer |
C_SEVERITY_ERROR
Messages about settings which aren't correct. CONTENIDO won't work |
#
4
|
integer |
CON_PREDICT_SUFFICIENT
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are okay |
#
1
|
integer |
CON_PREDICT_NOTPREDICTABLE
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are not predictable (we can't figure the server UID) |
#
2
|
integer |
CON_PREDICT_CHANGEPERM_SAMEOWNER
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the owner have to be changed |
#
3
|
integer |
CON_PREDICT_CHANGEPERM_SAMEGROUP
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the group have to be changed |
#
4
|
integer |
CON_PREDICT_CHANGEPERM_OTHERS
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for others should be changed |
#
5
|
integer |
CON_PREDICT_CHANGEUSER
Possible result of cSystemtest::predictCorrectFilePermissions() The owner of the file should be changed |
#
6
|
integer |
CON_PREDICT_CHANGEGROUP
Possible result of cSystemtest::predictCorrectFilePermissions() The group of the file should be changed |
#
7
|
integer |
CON_PREDICT_WINDOWS
Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are unpredictable because Windows |
#
8
|
integer |
CON_BASEDIR_NORESTRICTION
Possible result of cSystemtest::checkOpenBaseDir(). No restrictions |
#
1
|
integer |
CON_BASEDIR_DOTRESTRICTION
Possible result of cSystemtest::checkOpenBaseDir(). The Basedir is set to ".". CONTENIDO won't work |
#
2
|
integer |
CON_BASEDIR_RESTRICTIONSUFFICIENT
Possible result of cSystemtest::checkOpenBaseDir(). Open basedir is in effect but CONTENIDO works anyway |
#
3
|
integer |
CON_BASEDIR_INCOMPATIBLE
Possible result of cSystemtest::checkOpenBaseDir(). Open basedir is in effect and CONTENIDO doesn't work with it |
#
4
|
integer |
CON_EXTENSION_AVAILABLE
Possible result of cSystemtest::isPHPExtensionLoaded() The extension is loaded |
#
1
|
integer |
CON_EXTENSION_UNAVAILABLE
Possible result of cSystemtest::isPHPExtensionLoaded() The extension is not loaded |
#
2
|
integer |
CON_EXTENSION_CANTCHECK
Possible result of cSystemtest::isPHPExtensionLoaded() It was unable to check wether the extension is loaded or not |
#
3
|
integer |
CON_IMAGERESIZE_GD
Possible result of cSystemtest::checkImageResizer() GD is available for image resizing |
#
1
|
integer |
CON_IMAGERESIZE_IMAGEMAGICK
Possible result of cSystemtest::checkImageResizer() ImageMagick is available for image resizing |
#
2
|
integer |
CON_IMAGERESIZE_CANTCHECK
Possible result of cSystemtest::checkImageResizer() It was unable to check which extension is available for image resizing |
#
3
|
integer |
CON_IMAGERESIZE_NOTHINGAVAILABLE
Possible result of cSystemtest::checkImageResizer() No fitting extension is available |
#
4
|
integer |
CON_MYSQL_OK
Possible result of cSystemtest::testMySQL() Everything works fine with the given settings |
#
1
|
integer |
CON_MYSQL_STRICT_MODE
Possible result of cSystemtest::testMySQL() Strict mode is activated. CONTENIDO won't work |
#
2
|
integer |
CON_MYSQL_CANT_CONNECT
Possible result of cSystemtest::testMySQL() Strict mode is activated. CONTENIDO won't work |
#
3
|
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 |