Skip to content

Commit b293dcd

Browse files
authored
improve error message if debug_kit doesn't work due to TLD whitelist (#920)
Improve error message if debug_kit configuration problems have been detected
1 parent 59828d7 commit b293dcd

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

templates/Pages/home.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
$error .= '<br />' . $attributes['message'];
3737
}
3838
}
39+
if ($name === 'debug_kit') {
40+
$error = 'Try adding your current <b>top level domain</b> to the
41+
<a href="https://book.cakephp.org/debugkit/4/en/index.html#configuration" target="_blank">DebugKit.safeTld</a>
42+
config and reload.';
43+
if (!in_array('sqlite', \PDO::getAvailableDrivers())) {
44+
$error .= '<br />You need to install the PHP extension <code>pdo_sqlite</code> so DebugKit can work properly.';
45+
}
46+
}
3947
}
4048

4149
return compact('connected', 'error');
@@ -177,7 +185,7 @@
177185
<?php if ($result['connected']) : ?>
178186
<li class="bullet success">DebugKit can connect to the database.</li>
179187
<?php else : ?>
180-
<li class="bullet problem">DebugKit is <strong>not</strong> able to connect to the database.<br /><?= $result['error'] ?></li>
188+
<li class="bullet problem">There are configuration problems present which need to be fixed:<br /><?= $result['error'] ?></li>
181189
<?php endif; ?>
182190
<?php else : ?>
183191
<li class="bullet problem">DebugKit is <strong>not</strong> loaded.</li>

0 commit comments

Comments
 (0)