aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-15 13:46:08 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-15 13:46:08 +0000
commitc6f3234b15bdbd2de3dda10c9941b36ed147fb76 (patch)
tree601a29ca7fc5792feb68469b4fff80388d7eeec8 /engine/lib/database.php
parentd5b835cbf12253bdbb3ce2c89f97e921e06ad1f2 (diff)
downloadelgg-c6f3234b15bdbd2de3dda10c9941b36ed147fb76.tar.gz
elgg-c6f3234b15bdbd2de3dda10c9941b36ed147fb76.tar.bz2
Adding more plugin-related fun
git-svn-id: https://code.elgg.org/elgg/trunk@41 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php7
1 files changed, 6 insertions, 1 deletions
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) {