diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-02-03 02:35:13 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-02-03 02:35:13 -0500 |
commit | 675fd21cf145ff882463d604fe9e4bf9defa256e (patch) | |
tree | 394a8fbc073b1e7bda9de012e88b627247d20e58 /lib/debug.lib.php | |
parent | ab1856901367eab3ee390047f7829bdabfd2410d (diff) | |
download | ampache-675fd21cf145ff882463d604fe9e4bf9defa256e.tar.gz ampache-675fd21cf145ff882463d604fe9e4bf9defa256e.tar.bz2 ampache-675fd21cf145ff882463d604fe9e4bf9defa256e.zip |
Add a check that makes sure PDO is available
Calling an unavailable class is a fatal error, so people without PDO
were left with a fairly useless blank screen and no indicator of what
was wrong. Let's be a bit more user-friendly.
Diffstat (limited to 'lib/debug.lib.php')
-rw-r--r-- | lib/debug.lib.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php index f1c5dbcc..f96c9ffa 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -74,6 +74,19 @@ function check_php_pcre() { } // check_php_pcre /** + * check_pdo + * + * Checks to make sure that PDO is available. + */ +function check_pdo() { + if (class_exists('PDO') && in_array('mysql', PDO::getAvailableDrivers())) { + return true; + } + + return false; +} + +/** * check_config_values * checks to make sure that they have at least set the needed variables */ |