aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-05 12:52:13 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-05 12:52:13 +0000
commitc949e085c33b6eaf2e1dda4add566d47ab1876cd (patch)
tree648f4d1fd9e1565aeae53c40ae883570fe16963f /engine/lib/database.php
parent152405d1b34b8ba1a27b288eba53bb29ed2bf228 (diff)
downloadelgg-c949e085c33b6eaf2e1dda4add566d47ab1876cd.tar.gz
elgg-c949e085c33b6eaf2e1dda4add566d47ab1876cd.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Partial internationalisation of exceptions git-svn-id: https://code.elgg.org/elgg/trunk@801 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 55d2533c2..55ff021e5 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -48,9 +48,9 @@
// Connect to database
if (!$dblink[$dblinkname] = mysql_connect($CONFIG->dbhost, $CONFIG->dbuser, $CONFIG->dbpass, true))
- throw new DatabaseException("Elgg couldn't connect to the database using the given credentials.");
+ throw new DatabaseException(elgg_echo('DatabaseException:WrongCredentials'));
if (!mysql_select_db($CONFIG->dbname, $dblink[$dblinkname]))
- throw new DatabaseException("Elgg couldn't select the database {$CONFIG->dbname}.");
+ throw new DatabaseException(sprintf(elgg_echo('DatabaseException:NoConnect'), $CONFIG->dbname));
}
@@ -130,7 +130,7 @@
global $CONFIG, $dbcalls;
if (!callpath_gatekeeper($CONFIG->path . "engine/", true, true))
- throw new DatabaseException("Access to privileged function 'get_data()' is denied.");
+ throw new SecurityException(sprintf(elgg_echo('SecurityException:FunctionDenied'), 'get_data()'));
$dblink = get_db_link('read');
@@ -175,7 +175,7 @@
global $CONFIG, $dbcalls;
if (!callpath_gatekeeper($CONFIG->path . "engine/", true, true))
- throw new DatabaseException("Access to privileged function 'get_data_row()' is denied.");
+ throw new SecurityException(sprintf(elgg_echo('SecurityException:FunctionDenied'), 'get_data_row()'));
$dblink = get_db_link('read');
@@ -214,7 +214,7 @@
global $CONFIG, $dbcalls;
if (!callpath_gatekeeper($CONFIG->path . "engine/", true, true))
- throw new DatabaseException("Access to privileged function 'insert_data()' is denied.");
+ throw new SecurityException(sprintf(elgg_echo('SecurityException:FunctionDenied'), 'insert_data()'));
$dblink = get_db_link('write');
@@ -241,7 +241,7 @@
global $dbcalls, $CONFIG;
if (!callpath_gatekeeper($CONFIG->path . "engine/", true, true))
- throw new DatabaseException("Access to privileged function 'update_data()' is denied.");
+ throw new SecurityException(sprintf(elgg_echo('SecurityException:FunctionDenied'), 'update_data()'));
$dblink = get_db_link('write');
@@ -269,7 +269,7 @@
global $dbcalls, $CONFIG;
if (!callpath_gatekeeper($CONFIG->path . "engine/", true, true))
- throw new DatabaseException("Access to privileged function 'delete_data()' is denied.");
+ throw new SecurityException(sprintf(elgg_echo('SecurityException:FunctionDenied'), 'delete_data()'));
$dblink = get_db_link('write');
@@ -361,11 +361,11 @@
$errortxt = "";
foreach($errors as $error)
$errortxt .= " {$error};";
- throw new DatabaseException("There were a number of issues: " . $errortxt);
+ throw new DatabaseException(elgg_echo('DatabaseException:DBSetupIssues') . $errortxt);
}
} else {
- throw new DatabaseException("Elgg couldn't find the requested database script at {$scriptlocation}.");
+ throw new DatabaseException(sprintf(elgg_echo('DatabaseException:ScriptNotFound'), $scriptlocation));
}
}