From a80a88d99cb102fad4a23d5ea5732d489e70eddf Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 6 Apr 2010 16:16:50 -0300 Subject: Enhanced config check --- classes/SchemaDb.php | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'classes/SchemaDb.php') diff --git a/classes/SchemaDb.php b/classes/SchemaDb.php index 2756026..c00ae66 100644 --- a/classes/SchemaDb.php +++ b/classes/SchemaDb.php @@ -1,5 +1,9 @@ $value) { + if (!isset($schema[$key])) { + throw new Exception('Undefined required parameter '. $key .' on database configuration.'); + return FALSE; + } + + if (is_array($value)) { + if (SchemaDb::check($schema[$key], $section[$key]) == FALSE) { + return FALSE; + } + } + } + return $schema; } } -- cgit v1.2.3