VERSION-0.9.4.2 Database switch in order to disable the database adapter completly, minor bugfix in the postgress database adapter concerning the configuration settings. Added gitignore file

This commit is contained in:
stephan
2019-11-19 16:19:14 +01:00
parent a789d89515
commit a2c7170463
7 changed files with 70 additions and 35 deletions

View File

@@ -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()

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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";