From c6f3234b15bdbd2de3dda10c9941b36ed147fb76 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 15 Feb 2008 13:46:08 +0000 Subject: Adding more plugin-related fun git-svn-id: https://code.elgg.org/elgg/trunk@41 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib/database.php') diff --git a/engine/lib/database.php b/engine/lib/database.php index 66383afe3..55bfc602d 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -85,6 +85,7 @@ */ function init_db($event, $object_type, $object = null) { setup_db_connections(); + return true; } /** @@ -268,11 +269,14 @@ /** * Runs a full database script from disk * - * @param string $scriptlocation The full apth to the script + * @uses $CONFIG + * @param string $scriptlocation The full path to the script */ function run_sql_script($scriptlocation) { if ($script = file_get_contents($scriptlocation)) { + + global $CONFIG; $errors = array(); @@ -280,6 +284,7 @@ $sql_statements = preg_split('/;[\n\r]+/', $script); foreach($sql_statements as $statement) { $statement = trim($statement); + $statement = str_replace("prefix_",$CONFIG->dbprefix,$statement); if (!empty($statement)) { $result = update_data($statement); if ($result == false) { -- cgit v1.2.3