From f9a88ad930e966dcd6a26a5611dd096ae5be0828 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Mon, 13 Apr 2015 18:33:36 +0300 Subject: [PATCH] Old MySQL extension is not available in newer PHP versions. Signed-off-by: Dan Ungureanu Signed-off-by: Marc Delisle --- libraries/dbi/DBIMysql.class.php | 7 +++++++ test/classes/dbi/DBIMysql_test.php | 3 +++ 2 files changed, 10 insertions(+) diff --git a/libraries/dbi/DBIMysql.class.php b/libraries/dbi/DBIMysql.class.php index 36e81e6404..43973b28af 100644 --- a/libraries/dbi/DBIMysql.class.php +++ b/libraries/dbi/DBIMysql.class.php @@ -10,6 +10,13 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! extension_loaded('mysql')) { + // The old MySQL extension is deprecated as of PHP 5.5.0, and will be + // removed in the future. Instead, the `MySQLi` or `PDO_MySQL` extension + // should be used. + return; +} + require_once './libraries/dbi/DBIExtension.int.php'; /** diff --git a/test/classes/dbi/DBIMysql_test.php b/test/classes/dbi/DBIMysql_test.php index 7469a01b6a..3bb9969d41 100644 --- a/test/classes/dbi/DBIMysql_test.php +++ b/test/classes/dbi/DBIMysql_test.php @@ -38,6 +38,9 @@ class PMA_DBI_Mysql_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { + if (! extension_loaded('mysql')) { + $this->markTestSkipped('The MySQL extension is not available.'); + } $GLOBALS['cfg']['Server']['ssl'] = true; $GLOBALS['cfg']['PersistentConnections'] = false; $GLOBALS['cfg']['Server']['compress'] = true;