diff options
Diffstat (limited to 'classes/SchemaDb.php')
-rw-r--r-- | classes/SchemaDb.php | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/classes/SchemaDb.php b/classes/SchemaDb.php index 4cf77e6..2756026 100644 --- a/classes/SchemaDb.php +++ b/classes/SchemaDb.php @@ -2,14 +2,49 @@ class SchemaDb { /** - * Return a default example schema. + * Return the required database config. * - * @see IsisDb::default_schema() - */ - public function default_schema() { + * @return + * Array with required config. + */ + public function required() { $schema = array( 'db' => array( 'name' => 'dbname', + ), + 'fields' => array( + ), + ); + + return $schema; + } + + /** + * Return the optional database config. + * + * @return + * Array with optional config. + */ + public function optional() { + $schema = array( + 'db' => array( + 'charset' => 'charset', + ), + ); + + return $schema; + } + + /** + * Return an example schema. + * + * @see IsisDb::example() + */ + public function example() { + $required = SchemaDb::required(); + $optional = SchemaDb::optional(); + $schema = array( + 'db' => array( 'charset' => 'charset', ), 'fields' => array( @@ -26,6 +61,15 @@ class SchemaDb { ), ); + return array_merge_recursive($required, $optional, $schema); + } + + /** + * Check required fields. + * + * @todo + */ + function check($schema = NULL) { return $schema; } } |