Skip to content
Snippets Groups Projects
Commit 278e2dd3 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Add maintenance-page error screens when the php module for the dbtype is not...

- Add maintenance-page error screens when the php module for the dbtype is not loaded (just showed a blank screen before)
parent 3fad92fc
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -21,6 +21,15 @@
* (e.g. your database and web server live on different machines).
*/
function db_connect($url) {
// Check if MySQL support is present in PHP
if (!function_exists('mysql_connect')) {
drupal_maintenance_theme();
drupal_set_title('PHP MySQL support not enabled');
print theme('maintenance_page', '<p>We were unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your <code>PHP.ini</code> to see how you can enable it.</p>
<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
exit;
}
$url = parse_url($url);
// Allow for non-standard MySQL port.
......
......@@ -21,6 +21,15 @@
* Note that mysqli does not support persistent connections.
*/
function db_connect($url) {
// Check if MySQLi support is present in PHP
if (!function_exists('mysqli_init')) {
drupal_maintenance_theme();
drupal_set_title('PHP MySQL support not enabled');
print theme('maintenance_page', '<p>We were unable to use the MySQL database because the MySQLi extension for PHP is not installed. Check your <code>PHP.ini</code> to see how you can enable it.</p>
<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
exit;
}
$url = parse_url($url);
// Allow for non-standard MySQL port.
......
......@@ -21,6 +21,15 @@
* (e.g. your database and web server live on different machines).
*/
function db_connect($url) {
// Check if MySQL support is present in PHP
if (!function_exists('pg_connect')) {
drupal_maintenance_theme();
drupal_set_title('PHP PostgreSQL support not enabled');
print theme('maintenance_page', '<p>We were unable to use the PostgreSQL database because the PostgreSQL extension for PHP is not installed. Check your <code>PHP.ini</code> to see how you can enable it.</p>
<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
exit;
}
$url = parse_url($url);
$conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] . ' host=' . $url['host'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment