Methods

Caches the given config array for later use.

__construct(array $config) 

Parameters

$config

array

A config array which should be similar to CONTENIDO's $cfg

Checks the available image resizer classes and functions

checkImageResizer() : int

Returns

intReturns one of the CON_IMAGERESIZE constants

Checks for the open_basedir directive and returns one of the CON_BASEDIR constants

checkOpenBasedirCompatibility() : int

Returns

int

Returns the message array

getResults() : array
see \cSystemtest::$_messages

Returns

array

getSafeModeGidStatus()

getSafeModeGidStatus() 

getSafeModeStatus()

getSafeModeStatus() 

Checks if a given extension is loaded.

isPHPExtensionLoaded(string $extension) : int

Parameters

$extension

string

A PHP extension

Returns

intReturns one of the CON_EXTENSION constants

Returns true if the interpreter is run on Windows

isWindows() : boolean

Returns

boolean

Runs all available tests and stores the resuls in the messages array

runTests(bool $testFileSystem) 

Parameters

$testFileSystem

bool

If this is true the file system checks will be performed too with standard settings.

Stores a result in the messages array for later display

storeResult(bool $result, int $severity, string $errorHeadline, string $errorMessage, string $successHeadline, string $successMessage) 

Parameters

$result

bool

true for success, false otherwise

$severity

int

One one of the C_SEVERITY constants

$errorHeadline

string

The headline which will be stored in the case that $result is false

$errorMessage

string

The message which will be stored in the case that $result is false

$successHeadline

string

The headline which will be stored in the case that $result is true

$successMessage

string

The message which will be stored in the case that $result is true

testDOMDocument()

testDOMDocument() 

testFileUploadSetting()

testFileUploadSetting() 

testFilesystem()

testFilesystem($testConfig, $testFrontend) 

Parameters

$testConfig

$testFrontend

testGDGIFRead()

testGDGIFRead() 

testGDGIFWrite()

testGDGIFWrite() 

testGDJPEGRead()

testGDJPEGRead() 

testGDJPEGWrite()

testGDJPEGWrite() 

testGDPNGRead()

testGDPNGRead() 

testGDPNGWrite()

testGDPNGWrite() 

testIconv()

testIconv() 

testMagicQuotesRuntimeSetting()

testMagicQuotesRuntimeSetting() 

testMagicQuotesSybaseSetting()

testMagicQuotesSybaseSetting() 

testMaxExecutionTime()

testMaxExecutionTime() 

testMemoryLimit()

testMemoryLimit() 

testMySQL()

testMySQL($host, $username, $password) 

Parameters

$host

$username

$password

testMySQLExtension()

testMySQLExtension() 

testMySQLModeStrict()

testMySQLModeStrict($host, $username, $password) 

Parameters

$host

$username

$password

testMySQLiExtension()

testMySQLiExtension() 

testPHPExtension()

testPHPExtension($ext) 

Parameters

$ext

testPHPSQLSafeMode()

testPHPSQLSafeMode() 

Test functions

testPHPVersion() 

They all return true if the test passed and false if not

testXMLParserCreate()

testXMLParserCreate() 

testZIPArchive()

testZIPArchive() 

Returns true if the given file is a directory and if it is writeable

canWriteDir(string $dirname) : boolean

Parameters

$dirname

string

The path to the directory

Returns

boolean

Returns true if the file is writeable

canWriteFile(string $filename) : boolean

Parameters

$filename

string

The path to the file

Returns

boolean

Connects to the database with the given settings

doMySQLConnect(string $host, string $username, string $password) : \multitype:boolean

Parameters

$host

string

The database host

$username

string

The database user

$password

string

The database user password

Returns

\multitype:booleancDb Returns an array with the cDB object on the first place and a boolean on the second

Converts a string like "12M" to the correct number of bytes

getAsBytes(string $val) : \number

Parameters

$val

string

A string in the form of "12K", "12M" or "12G"

Returns

\number

Returns an array with information about the file, especially the file owner

getFileInfo(string $sFilename) : boolean | array

The return array looks like this: array( "info" => $info, //'s' for a socket, 'l' for a symbolic link, '-' for a regular file, 'b' "block special", 'd' for a directory, 'c' "character special", 'p' FIFO pipe, 'u' for unkown "type" => $type, //A more descriptive version of $info "owner" => array( "id" => $id, //the owner id "read" => $read, //true if the owner is allowed to read the file "write" => $write //true if the owner is allowed to write the file ) "group" => array( "id" => $id, //the owner group "read" => $read, //true if the owner group is allowed to read the file "write" => $write //true if the owner group is allowed to write the file ) "others" => array( "read" => $read, //true if others are allowed to read the file "write" => $write //true if others are allowed to write the file ) )

Parameters

$sFilename

string

The path to the file

Returns

booleanarrayFalse if the file can't be accessed

Gets a PHP setting with ini_get

getPHPIniSetting(string $setting) : mixed

Parameters

$setting

string

A PHP setting

Returns

mixedThe value of the PHP setting or NULL if ini_get is disabled

Returns the current group which runs the PHP interpreter

getServerGID() : \number | boolean

Returns

\numberbooleanUser ID or false if unable to determine the group

Returns the current user which runs the PHP interpreter

getServerUID() : \number | boolean

Returns

\numberbooleanUser ID or false if unable to determine the user

Returns one of the CON_PREDICT suggestions depending on the permissions of the given file

predictCorrectFilepermissions(string $file) : int

Parameters

$file

string

The path to the file

Returns

intCON_PREDICT_*

Checks a single file or directory wether it is writeable or not

testSingleFile(string $filename, int $severity, bool $dir) : boolean

Parameters

$filename

string

The file

$severity

int

The resulting C_SEVERITY constant should the test fail

$dir

bool

True if the $filename is a directory

Exceptions

\Exception Throws a generic Exception in the event that the permissions are wrong

Returns

booleanReturns true if everything is fine

 Properties

 

$_config : array
 

$_messages : array

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 );

 Constants

 

Possible result of cSystemtest::checkOpenBaseDir().

CON_BASEDIR_DOTRESTRICTION : int

The Basedir is set to ".". CONTENIDO won't work

 

Possible result of cSystemtest::checkOpenBaseDir().

CON_BASEDIR_INCOMPATIBLE : int

Open basedir is in effect and CONTENIDO doesn't work with it

 

Possible result of cSystemtest::checkOpenBaseDir().

CON_BASEDIR_NORESTRICTION : int

No restrictions

 

Possible result of cSystemtest::checkOpenBaseDir().

CON_BASEDIR_RESTRICTIONSUFFICIENT : int

Open basedir is in effect but CONTENIDO works anyway

 

Possible result of cSystemtest::isPHPExtensionLoaded() The extension is loaded

CON_EXTENSION_AVAILABLE : int
 

Possible result of cSystemtest::isPHPExtensionLoaded() It was unable to check wether the extension is loaded or not

CON_EXTENSION_CANTCHECK : int
 

Possible result of cSystemtest::isPHPExtensionLoaded() The extension is not loaded

CON_EXTENSION_UNAVAILABLE : int
 

Possible result of cSystemtest::checkImageResizer() It was unable to check which extension is available for image resizing

CON_IMAGERESIZE_CANTCHECK : int
 

Possible result of cSystemtest::checkImageResizer() GD is available for image resizing

CON_IMAGERESIZE_GD : int
 

Possible result of cSystemtest::checkImageResizer() ImageMagick is available for image resizing

CON_IMAGERESIZE_IMAGEMAGICK : int
 

Possible result of cSystemtest::checkImageResizer() No fitting extension is available

CON_IMAGERESIZE_NOTHINGAVAILABLE : int
 

Possible result of cSystemtest::testMySQL() Everything works fine with the given settings

CON_MYSQL_OK : int
 

Possible result of cSystemtest::testMySQL() Strict mode is activated.

CON_MYSQL_STRICT_MODE : int

CONTENIDO won't work

 

Possible result of cSystemtest::predictCorrectFilePermissions() The group of the file should be changed

CON_PREDICT_CHANGEGROUP : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for others should be changed

CON_PREDICT_CHANGEPERM_OTHERS : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the group have to be changed

CON_PREDICT_CHANGEPERM_SAMEGROUP : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions for the owner have to be changed

CON_PREDICT_CHANGEPERM_SAMEOWNER : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The owner of the file should be changed

CON_PREDICT_CHANGEUSER : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are not predictable (we can't figure the server UID)

CON_PREDICT_NOTPREDICTABLE : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are okay

CON_PREDICT_SUFFICIENT : int
 

Possible result of cSystemtest::predictCorrectFilePermissions() The filepermissions are unpredictable because Windows

CON_PREDICT_WINDOWS : int
 

The minimal PHP version

CON_SETUP_MIN_PHP_VERSION : string
 

Messages about settings which aren't correct.

C_SEVERITY_ERROR : int

CONTENIDO won't work

 

Messages are only to inform the user about something.

C_SEVERITY_INFO : int
 

Messages have no influence on the result of the system integrity

C_SEVERITY_NONE : int
 

Messages about settings which aren't correct, but CONTENIDO might work anyway

C_SEVERITY_WARNING : int