diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e376fe0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+core/l/*
\ No newline at end of file
diff --git a/README.md b/README.md
index ec743a3..4f24973 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Nibiru
### Rapid Prototyping PHP Framework
-Version 0.9.4.1 beta
+Version 0.9.4.2 beta
## Introduction
Nibiru is a rapid prototyping framework written in PHP and based on the MVC design pattern. Now one may say that writing
@@ -20,6 +20,9 @@ Engine Implementation.
Dwoo template engine ( untested )
Twig template engine ( untested )
PDO adapter to the MySQL database
+PDO adapter to the Postgress database
+ODBC adapter to the Postgress database
+Autogenerator for models corresponding to the database tables
- read datasets from a complete table
- read datasets by selection from a table
@@ -117,7 +120,6 @@ Engine Implementation.
- Add autoated class generator for MySQL database models
-Update
Version 0.9.3 beta 09.11.2019
- Autoloader is now supporting a better module structure
@@ -125,7 +127,13 @@ Engine Implementation.
- Updated the annotations for better autocompletion
- removed the Twig and Dwoo engines, they are not needed anymore
-
+Update
+Version 0.9.4.2
+
+ - Database is.active switch in the configuration file
+ - minor bugfix in the Postgress Database Adapter
+ - added .gitignore file
+
TODO
Still in progress for the next version
diff --git a/core/c/model.php b/core/c/model.php
index a2cb260..d88cad3 100644
--- a/core/c/model.php
+++ b/core/c/model.php
@@ -13,9 +13,16 @@ class Model extends Table
public function __construct($argv)
{
- parent::__construct($argv);
- $this->createOutFolder();
- $this->createClassFiles();
+ if(Config::getInstance()->getConfig()[IMysql::SETTINGS_DATABASE][IMysql::PLACE_IS_ACTIVE])
+ {
+ parent::__construct($argv);
+ $this->createOutFolder();
+ $this->createClassFiles();
+ }
+ else
+ {
+ return false;
+ }
}
private function createOutFolder()
diff --git a/core/c/mysql.php b/core/c/mysql.php
index 493561a..88bad66 100755
--- a/core/c/mysql.php
+++ b/core/c/mysql.php
@@ -34,14 +34,17 @@ class Mysql implements IMysql
{
$settings = Config::getInstance()->getConfig()[self::SETTINGS_DATABASE];
}
- $this->_setUsername($settings[self::PLACE_USERNAME]);
- $this->_setPassword($settings[self::PLACE_PASSWORD]);
- $this->_setDbname($settings[self::PLACE_DATABASE]);
- $this->_setDiver($settings[self::PLACE_DRIVER]);
- $this->_setHostname($settings[self::PLACE_HOSTNAME]);
- $this->_setPort($settings[self::PLACE_PORT]);
- $this->_setDsn();
- $this->_setConn();
+ if($settings[self::PLACE_IS_ACTIVE])
+ {
+ $this->_setUsername($settings[self::PLACE_USERNAME]);
+ $this->_setPassword($settings[self::PLACE_PASSWORD]);
+ $this->_setDbname($settings[self::PLACE_DATABASE]);
+ $this->_setDiver($settings[self::PLACE_DRIVER]);
+ $this->_setHostname($settings[self::PLACE_HOSTNAME]);
+ $this->_setPort($settings[self::PLACE_PORT]);
+ $this->_setDsn();
+ $this->_setConn();
+ }
}
public static function getInstance( $section = false )
diff --git a/core/c/odbc.php b/core/c/odbc.php
index a3221d6..18f74ec 100755
--- a/core/c/odbc.php
+++ b/core/c/odbc.php
@@ -27,15 +27,23 @@ class Odbc extends Mysql implements IOdbc
{
$settings = Config::getInstance()->getConfig()[self::SETTINGS_DATABASE];
}
- $this->_setUsername($settings[self::PLACE_USERNAME]);
- $this->_setPassword($settings[self::PLACE_PASSWORD]);
- $this->_setDbname($settings[self::PLACE_DATABASE]);
- $this->_setDiver($settings[self::PLACE_DRIVER]);
- $this->_setHostname($settings[self::PLACE_HOSTNAME]);
- $this->_setPort($settings[self::PLACE_PORT]);
- $this->_setReadOnly($settings[self::PLACE_READONLY]);
- $this->_setDsn();
- $this->_setConn();
+ if($settings[self::PLACE_IS_ACTIVE])
+ {
+ $this->_setUsername($settings[self::PLACE_USERNAME]);
+ $this->_setPassword($settings[self::PLACE_PASSWORD]);
+ $this->_setDbname($settings[self::PLACE_DATABASE]);
+ $this->_setDiver($settings[self::PLACE_DRIVER]);
+ $this->_setHostname($settings[self::PLACE_HOSTNAME]);
+ $this->_setPort($settings[self::PLACE_PORT]);
+ $this->_setReadOnly($settings[self::PLACE_READONLY]);
+ $this->_setDsn();
+ $this->_setConn();
+ }
+ else
+ {
+ return false;
+ }
+
}
public static function getInstance( $section = false )
diff --git a/core/c/psql.php b/core/c/psql.php
index ffa6f6a..6b621eb 100644
--- a/core/c/psql.php
+++ b/core/c/psql.php
@@ -23,19 +23,26 @@ class Psql extends Mysql implements IPsql
}
else
{
- $section = Config::getInstance()->getConfig()[self::SETTINGS_DATABASE];
+ $settings = Config::getInstance()->getConfig()[self::SETTINGS_DATABASE];
+ }
+ if($settings[self::PLACE_IS_ACTIVE])
+ {
+ $this->_setUsername($settings[self::PLACE_USERNAME]);
+ $this->_setPassword($settings[self::PLACE_PASSWORD]);
+ $this->_setDbname($settings[self::PLACE_DATABASE]);
+ $this->_setDiver($settings[self::PLACE_DRIVER]);
+ $this->_setHostname($settings[self::PLACE_HOSTNAME]);
+ $this->_setPort($settings[self::PLACE_PORT]);
+ $this->_setReadOnly($settings[self::PLACE_READONLY]);
+ $this->_setEncoding($settings[self::PLACE_ENCODING]);
+ $this->_setMultithreading($settings[self::PLACE_MULTI_THREADING]);
+ $this->_setDsn();
+ $this->_setConn();
+ }
+ else
+ {
+ return false;
}
- $this->_setUsername($settings[self::PLACE_USERNAME]);
- $this->_setPassword($settings[self::PLACE_PASSWORD]);
- $this->_setDbname($settings[self::PLACE_DATABASE]);
- $this->_setDiver($settings[self::PLACE_DRIVER]);
- $this->_setHostname($settings[self::PLACE_HOSTNAME]);
- $this->_setPort($settings[self::PLACE_PORT]);
- $this->_setReadOnly($settings[self::PLACE_READONLY]);
- $this->_setEncoding($settings[self::PLACE_ENCODING]);
- $this->_setMultithreading($settings[self::PLACE_MULTI_THREADING]);
- $this->_setDsn();
- $this->_setConn();
}
public static function getInstance( $section = false )
diff --git a/core/i/mysql.php b/core/i/mysql.php
index 77bde1f..83fea40 100644
--- a/core/i/mysql.php
+++ b/core/i/mysql.php
@@ -18,6 +18,7 @@ interface IMysql
const PLACE_QUERY_LIMIT = "NO LIMIT";
const PLACE_SORT_ORDER = "NO ORDER";
const PLACE_DSN = "NO CONNECTION STRING";
+ const PLACE_IS_ACTIVE = "is.active";
const PLACE_USERNAME = "username";
const PLACE_PASSWORD = "password";
const PLACE_HOSTNAME = "hostname";