Commit 4a5a98a6 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3203201 by Gábor Hojtsy: Check for JSON support in databases

parent 72b2a980
......@@ -678,6 +678,31 @@ MARKUP
]
];
// Check JSON support in database.
$class = 'no-known-error';
$requirement = $this->t('Supported.');
try {
\Drupal::database()->query('SELECT JSON_TYPE(\'1\')');
}
catch (\Exception $e) {
$class = 'known-error';
$status = FALSE;
$requirement = $this->t('Not supported.');
}
$build['data']['#rows'][] = [
'class' => [$class],
'data' => [
'requirement' => [
'class' => 'requirement-label',
'data' => $this->t('Database JSON support required'),
],
'status' => [
'data' => $requirement,
'class' => 'status-info',
],
]
];
// Save the overall status indicator in the build array. It will be
// popped off later to be used in the summary table.
$build['status'] = $status;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment