From 63a6a68ec94679952a1479530924fb4b50967175 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 26 Apr 2010 13:45:05 -0300 Subject: Enhancements on check() implementations --- classes/BiblioIsisDb.php | 7 +++++++ classes/MaleteDb.php | 7 +++++++ classes/PhpIsisDb.php | 7 +++++++ 3 files changed, 21 insertions(+) (limited to 'classes') diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php index 616cc77..d7fdd1c 100644 --- a/classes/BiblioIsisDb.php +++ b/classes/BiblioIsisDb.php @@ -118,6 +118,13 @@ class BiblioIsisDb implements IsisDb { * @see IsisDb::check() */ public function check($schema, $section = NULL) { + // Check API availability. + if (!class_exists('Perl')) { + throw new Exception('Could not find Perl class. Please check your php-perl installation.'); + return FALSE; + } + + // Check schema configuration. return SchemaDb::check($schema, $section); } diff --git a/classes/MaleteDb.php b/classes/MaleteDb.php index 7fa0afa..201ddc0 100644 --- a/classes/MaleteDb.php +++ b/classes/MaleteDb.php @@ -98,6 +98,13 @@ class MaleteDb implements IsisDb { * @see IsisDb::check() */ public function check($schema, $section = NULL) { + // Check API availability. + if (!class_exists('Isis_Db')) { + throw new Exception('Could not find Isis_Db class. Please check your malete installation.'); + return FALSE; + } + + // Check schema configuration. return SchemaDb::check($schema, $section); } diff --git a/classes/PhpIsisDb.php b/classes/PhpIsisDb.php index 136b657..1f64075 100644 --- a/classes/PhpIsisDb.php +++ b/classes/PhpIsisDb.php @@ -87,6 +87,13 @@ class PhpIsisDb implements IsisDb { * @see IsisDb::check() */ public function check($schema, $section = NULL) { + // Check API availability. + if (!function_exists('isis_open')) { + throw new Exception('Could not find function isis_open. Please check your php-isis installation.'); + return FALSE; + } + + // Check schema configuration. return SchemaDb::check($schema, $section); } -- cgit v1.2.3