diff options
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB.php | 23 | ||||
-rw-r--r-- | system/database/DB_driver.php | 2 | ||||
-rw-r--r-- | system/database/DB_utility.php | 2 | ||||
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 2 | ||||
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php | 2 |
5 files changed, 18 insertions, 13 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index d411b679e..8ea7ca6fa 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -61,18 +61,23 @@ function &DB($params = '', $query_builder_override = NULL) } include($file_path); - // Make packages contain database config files - foreach (get_instance()->load->get_package_paths() as $path) + + // Make packages contain database config files, + // given that the controller instance already exists + if (class_exists('CI_Controller', FALSE)) { - if ($path !== APPPATH) + foreach (get_instance()->load->get_package_paths() as $path) { - if (file_exists($file_path = $path.'config/'.ENVIRONMENT.'/database.php')) - { - include($file_path); - } - elseif (file_exists($file_path = $path.'config/database.php')) + if ($path !== APPPATH) { - include($file_path); + if (file_exists($file_path = $path.'config/'.ENVIRONMENT.'/database.php')) + { + include($file_path); + } + elseif (file_exists($file_path = $path.'config/database.php')) + { + include($file_path); + } } } } diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index a0803f170..bbe65b410 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -822,7 +822,7 @@ abstract class CI_DB_driver { { if ( ! $this->trans_enabled) { - return FALSE; + return; } // When transactions are nested we only begin/commit/rollback the outermost ones diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 774d51533..57356ac53 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -316,7 +316,7 @@ abstract class CI_DB_utility { * Database Backup * * @param array $params - * @return void + * @return string */ public function backup($params = array()) { diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index c8d7c770d..844ffab8f 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -154,7 +154,7 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { */ protected function _list_tables($prefix_limit = FALSE) { - return 'SELECT '.$this->escape_identifiers('name') + $sql = 'SELECT '.$this->escape_identifiers('name') .' FROM '.$this->escape_identifiers('sysobjects') .' WHERE '.$this->escape_identifiers('type')." = 'U'"; diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php index b5bdbf91a..f8ae5f6db 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php @@ -183,7 +183,7 @@ class CI_DB_pdo_sqlsrv_driver extends CI_DB_pdo_driver { */ protected function _list_tables($prefix_limit = FALSE) { - return 'SELECT '.$this->escape_identifiers('name') + $sql = 'SELECT '.$this->escape_identifiers('name') .' FROM '.$this->escape_identifiers('sysobjects') .' WHERE '.$this->escape_identifiers('type')." = 'U'"; |