This commit is contained in:
flash 2015-03-21 15:37:36 +01:00
parent e7e99a024f
commit 5470620148
2 changed files with 13 additions and 13 deletions

View file

@ -27,23 +27,23 @@ class Database {
// Initialise connection // Initialise connection
self::initConnect( self::initConnect(
( (
Board::getConfig('db', 'unixsocket') ? Configuration::getLocalConfig('db', 'unixsocket') ?
self::prepareSock( self::prepareSock(
Board::getConfig('db', 'host'), Configuration::getLocalConfig('db', 'host'),
Board::getConfig('db', 'database') Configuration::getLocalConfig('db', 'database')
) : ) :
self::prepareHost( self::prepareHost(
Board::getConfig('db', 'host'), Configuration::getLocalConfig('db', 'host'),
Board::getConfig('db', 'database'), Configuration::getLocalConfig('db', 'database'),
( (
Board::getConfig('db', 'port') !== null ? Configuration::getLocalConfig('db', 'port') !== null ?
Board::getConfig('db', 'port') : Configuration::getLocalConfig('db', 'port') :
3306 3306
) )
) )
), ),
Board::getConfig('db', 'username'), Configuration::getLocalConfig('db', 'username'),
Board::getConfig('db', 'password') Configuration::getLocalConfig('db', 'password')
); );
} }
@ -85,7 +85,7 @@ class Database {
public static function fetch($table, $fetchAll = true, $data = null, $order = null, $limit = null, $group = null, $distinct = false, $column = '*') { public static function fetch($table, $fetchAll = true, $data = null, $order = null, $limit = null, $group = null, $distinct = false, $column = '*') {
// Begin preparation of the statement // Begin preparation of the statement
$prepare = 'SELECT '. ($distinct ? 'DISTINCT ' : '') . $column .' FROM `' . Board::getConfig('db', 'prefix') . $table . '`'; $prepare = 'SELECT '. ($distinct ? 'DISTINCT ' : '') . $column .' FROM `' . Configuration::getLocalConfig('db', 'prefix') . $table . '`';
// If $data is set and is an array continue // If $data is set and is an array continue
if(is_array($data)) { if(is_array($data)) {
@ -175,7 +175,7 @@ class Database {
public static function insert($table, $data) { public static function insert($table, $data) {
// Begin preparation of the statement // Begin preparation of the statement
$prepare = 'INSERT INTO `' . Board::getConfig('db', 'prefix') . $table . '` '; $prepare = 'INSERT INTO `' . Configuration::getLocalConfig('db', 'prefix') . $table . '` ';
// Run the foreach statement twice for (`stuff`) VALUES (:stuff) // Run the foreach statement twice for (`stuff`) VALUES (:stuff)
for($i = 0; $i < 2; $i++) { for($i = 0; $i < 2; $i++) {
@ -215,7 +215,7 @@ class Database {
public static function update($table, $data) { public static function update($table, $data) {
// Begin preparation of the statement // Begin preparation of the statement
$prepare = 'UPDATE `' . Board::getConfig('db', 'prefix') . $table . '`'; $prepare = 'UPDATE `' . Configuration::getLocalConfig('db', 'prefix') . $table . '`';
// Run a foreach on $data and complete the statement // Run a foreach on $data and complete the statement
foreach($data as $key => $values) { foreach($data as $key => $values) {

View file

@ -39,7 +39,7 @@ else
// Set Error handler // Set Error handler
set_error_handler(array('Flashii\Flashii', 'ErrorHandler')); set_error_handler(array('Flashii\Main', 'ErrorHandler'));
// Initialise Flashii Class // Initialise Flashii Class
Main::init($fiiConf); Main::init($fiiConf);