*/
protected $system_checks = [
'checkMemory',
- 'checkServerVariables',
'checkMysqlConnectExists',
'checkJsonEncodeExists',
'checkMultibyteExists',
];
+ protected $system_checks_web = [
+ 'checkServerVariables',
+ ];
+
protected $database_checks = [
'checkMysqlConnection',
'checkMysqlVersion',
* An array of check summaries. Each array contains the keys 'title', 'severity', and 'details'.
*/
public function checkAll(array $config) {
+ if (!class_exists('\CRM_Utils_SQL_TempTable')) {
+ require_once dirname(__FILE__) . '/../../CRM/Utils/SQL/TempTable.php';
+ }
return array_merge($this->checkSystem($config['file_paths']), $this->checkDatabase($config['db_config']));
}
$errors[] = $this->$check();
}
+ if (PHP_SAPI !== 'cli') {
+ foreach ($this->system_checks_web as $check) {
+ $errors[] = $this->$check();
+ }
+ }
+
return $errors;
}
return $results;
}
- if (version_compare($info, $min) == -1) {
+ $versionDetails = mysqli_query($conn, 'SELECT version() as version')->fetch_assoc();
+ if (version_compare($versionDetails['version'], $min) == -1) {
$results['severity'] = $this::REQUIREMENT_ERROR;
$results['details'] = "MySQL version is {$info}; minimum required is {$min}";
return $results;
$results['details'] = "Could not select the database";
return $results;
}
-
- $r = mysqli_query($conn, 'CREATE TEMPORARY TABLE civicrm_install_temp_table_test (test text)');
+ $temporaryTableName = \CRM_Utils_SQL_TempTable::build()->setCategory('install')->getName();
+ $r = mysqli_query($conn, 'CREATE TEMPORARY TABLE ' . $temporaryTableName . ' (test text)');
if (!$r) {
$results['severity'] = $this::REQUIREMENT_ERROR;
$results['details'] = "Database does not support creation of temporary tables";
return $results;
}
- mysqli_query($conn, 'DROP TEMPORARY TABLE civicrm_install_temp_table_test');
+ mysqli_query($conn, 'DROP TEMPORARY TABLE ' . $temporaryTableName);
return $results;
}