Skip to content
Snippets Groups Projects

Check if mysqli extension is installed.

2 files
+ 26
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -52,24 +52,32 @@ class ServerBenchmarksForm extends FormBase {
];
// Get the DB benchmarks.
$dbResults = (new DbBenchmarks())->getResults($iterations);
if ($dbResults = (new DbBenchmarks())->getResults($iterations)) {
// Output DB benchmarks as a table.
$header = [$this->t('Benchmarks (DB)'), $this->t('Description'), $this->t('Time (seconds)')];
// Output DB benchmarks as a table.
$header = [$this->t('Benchmarks (DB)'), $this->t('Description'), $this->t('Time (seconds)')];
$data = [];
$data = [];
foreach ($dbResults as $key => $benchmark) {
$data[] = [
$benchmark['title'], $benchmark['description'], $benchmark['result'],
foreach ($dbResults as $key => $benchmark) {
$data[] = [
$benchmark['title'], $benchmark['description'], $benchmark['result'],
];
}
$form[] = [
'#theme' => 'table',
'#header' => $header,
'#rows' => $data,
];
}
$form[] = [
'#theme' => 'table',
'#header' => $header,
'#rows' => $data,
];
} else {
$form[] = [
'#markup' => '<p>' . $this->t('Database benchmarks are unavailable. Check if the PHP mysqli extension is installed.') . '</p>',
];
}
// Get the Io benchmarks.
$ioResults = (new IoBenchmarks())->getResults($iterations);
Loading