Version 0.9.5 beta - update for database functionality, updated the db.class.mask, and the mysql autogeneration for files.
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user