aboutsummaryrefslogtreecommitdiff
path: root/classes/SchemaDb.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-04-06 14:05:07 -0300
committerSilvio <silvio@devlet.com.br>2010-04-06 14:05:07 -0300
commitf6f1d270419bbd9696974719b15b8c01b19b032b (patch)
treeb27a0cd0cc3e79a9d7d1b8fa75e183411db79569 /classes/SchemaDb.php
parentf3fea8713e9c82b3afe2c54a8fa997396f8bb87b (diff)
downloadcinisis-f6f1d270419bbd9696974719b15b8c01b19b032b.tar.gz
cinisis-f6f1d270419bbd9696974719b15b8c01b19b032b.tar.bz2
Config parse and check
Diffstat (limited to 'classes/SchemaDb.php')
-rw-r--r--classes/SchemaDb.php52
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;
}
}