diff --git a/README.md b/README.md
index 9a50028..f1f201f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Nibiru
### Rapid Prototyping PHP Framework
-Version 0.9.4.2 beta
+Version 0.9.5 beta
## Introduction
Nibiru is a rapid prototyping framework written in PHP and based on the MVC design pattern. Now one may say that writing
@@ -127,7 +127,6 @@ Engine Implementation.
Updated the annotations for better autocompletion
removed the Twig and Dwoo engines, they are not needed anymore
-Update
Version 0.9.4.3
- Database is.active switch in the configuration file
@@ -143,6 +142,19 @@ Engine Implementation.
- soap interface to a given SOAP server (canceled, not needed to old)
- bitcoin api, and payment gateway
+Update
+Version 0.9.5
+
+ - Added Autogenerator for database tables
+ - Fixed some minor bug in the db.class.mask
+
+TODO
+Still in progress for the next version
+
+- framework documentation
+- class documentation
+- bitcoin api, and payment gateway
+
The start is done, have success with PHP prototyping, and always remember to have fun!
Author: Stephan Kasdorf
\ No newline at end of file
diff --git a/application/settings/db/db.class.mask b/application/settings/db/db.class.mask
index 0f07293..8eefa3b 100755
--- a/application/settings/db/db.class.mask
+++ b/application/settings/db/db.class.mask
@@ -20,7 +20,7 @@ class [CLASSNAME] extends Db
public function __construct()
{
- [ADAPTER]::settingsSection('[DBSECTION]');
+ [CONNECTOR]::settingsSection('[DBSECTION]');
self::initTable( self::TABLE );
}
@@ -29,8 +29,4 @@ class [CLASSNAME] extends Db
return self::TABLE;
}
- public function insertArrayIntoTable($dataset = array())
- {
- // TODO: Implement insertArrayIntoTable() method.
- }
}
\ No newline at end of file
diff --git a/core/c/model.php b/core/c/model.php
index d88cad3..17e13fb 100644
--- a/core/c/model.php
+++ b/core/c/model.php
@@ -106,15 +106,18 @@ class Model extends Table
if(Config::getInstance()->getConfig()[self::CONFIG_SECTION]['odbc'])
{
$template = str_replace('[ADAPTER]', self::ADAPTER_POSTGRES, $template);
+ $template = str_replace('[CONNECTOR]', self::ADAPTER_POSTGRES, $template);
}
else
{
$template = str_replace('[ADAPTER]', self::ADAPTER_POSTGRESQL, $template);
+ $template = str_replace('[CONNECTOR]', self::ADAPTER_POSTGRESQL, $template);
}
}
if($this->getDatabaseDriver()==self::DB_DRIVER_MYSQL)
{
$template = str_replace('[ADAPTER]', self::ADAPTER_MYSQL, $template);
+ $template = str_replace('[CONNECTOR]', self::ADAPTER_PDO, $template);
}
if(Config::getInstance()->getConfig()[self::CONFIG_SECTION][self::DB_OVERWRITE_MODELS])
diff --git a/core/c/table.php b/core/c/table.php
index 812405b..c56e0de 100644
--- a/core/c/table.php
+++ b/core/c/table.php
@@ -23,6 +23,7 @@ class Table
const ADAPTER_POSTGRES = "Postgres";
const ADAPTER_POSTGRESQL = "Postgresql";
const ADAPTER_MYSQL = "MySQL";
+ const ADAPTER_PDO = "Pdo";
const PARAMETERS = array(
'--table',
@@ -228,7 +229,13 @@ class Table
}
if($this->getDatabaseDriver()==self::DB_DRIVER_MYSQL)
{
- //TODO: Implement the Table array for MySQL
+ Pdo::settingsSection( $this->getConfigSection() );
+ $result = Pdo::queryString('SHOW TABLES;');
+ foreach ($result as $entry)
+ {
+ $this->_setFields(array_shift($entry));
+ $this->_tables[array_shift($entry)] = $this->getFields();
+ }
}
}
@@ -344,7 +351,12 @@ class Table
}
if($this->getDatabaseDriver()==self::DB_DRIVER_MYSQL)
{
- //TODO: Implement the Table array for MySQL
+ Pdo::settingsSection( $this->getConfigSection() );
+ $result = Pdo::queryString('DESCRIBE ' . $table . ';' );
+ foreach($result as $field)
+ {
+ $this->_fields[] = $field['Field'];
+ }
}
}