summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-05-12 02:03:51 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-05-12 02:03:51 +0200
commit7f88aa51fb56cb6e0d50f55f07fd8638d7a625b2 (patch)
tree5122b495baaf7e71ccec45e90c36e9bf203367e6
parent307cd619a56cc8ab40b978e3bf1f4dd373d312f0 (diff)
changed class instantiations to reference global $LANG and fetch existing Exceptions class, and added language variable for database error heading
http://codeigniter.com/bug_tracker/bug/4421/
-rw-r--r--system/database/DB_driver.php21
-rw-r--r--system/language/english/db_lang.php4
-rw-r--r--user_guide/changelog.html1
3 files changed, 10 insertions, 16 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index c296d4ca8..35bdc29b6 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1117,12 +1117,11 @@ class CI_DB_driver {
*/
function display_error($error = '', $swap = '', $native = FALSE)
{
-// $LANG = new CI_Lang();
- $LANG = new CI_Language();
+ global $LANG;
$LANG->load('db');
- $heading = 'Database Error';
-
+ $heading = $LANG->line('db_error_heading');
+
if ($native == TRUE)
{
$message = $error;
@@ -1131,20 +1130,14 @@ class CI_DB_driver {
{
$message = (! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
}
-
- if (! class_exists('CI_Exceptions'))
- {
-// include(BASEPATH.'core/Exceptions'.EXT);
- include(BASEPATH.'libraries/Exceptions'.EXT);
- }
- $error = new CI_Exceptions();
- echo $error->show_error('An Error Was Encountered', $message, 'error_db');
+ $error =& load_class('Exceptions');
+ echo $error->show_error($heading, $message, 'error_db');
exit;
}
}
-
-/* End of file DB_driver.php */
+
+/* End of file DB_driver.php */
/* Location: ./system/database/DB_driver.php */ \ No newline at end of file
diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php
index 6c053a139..697eb7880 100644
--- a/system/language/english/db_lang.php
+++ b/system/language/english/db_lang.php
@@ -21,7 +21,7 @@ $lang['db_table_name_required'] = 'A table name is required for that operation.'
$lang['db_column_name_required'] = 'A column name is required for that operation.';
$lang['db_column_definition_required'] = 'A column definition is required for that operation.';
$lang['db_unable_to_set_charset'] = 'Unable to set client connection character set: %s';
+$lang['db_error_heading'] = 'A Database Error Occurred';
-
-/* End of file db_lang.php */
+/* End of file db_lang.php */
/* Location: ./system/language/english/db_lang.php */ \ No newline at end of file
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index be5c8c964..c5231655c 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -139,6 +139,7 @@ SVN Commit: not currently released</p>
<li>Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).</li>
<li>Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.</li>
<li>Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.</li>
+ <li>Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.</li>
</ul>
<h2>Version 1.6.1</h2>