diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/actions.php | 1 | ||||
-rw-r--r-- | engine/lib/database.php | 7 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 6 | ||||
-rw-r--r-- | engine/lib/plugins.php | 4 | ||||
-rw-r--r-- | engine/schema/mysql.sql | 22 | ||||
-rw-r--r-- | engine/settings.example.php | 5 |
6 files changed, 29 insertions, 16 deletions
diff --git a/engine/lib/actions.php b/engine/lib/actions.php index e24659df1..035d26cf5 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -79,6 +79,7 @@ function actions_init($event, $object_type, $object) {
register_action("error");
+ return true;
}
// Register some actions ***************************************************
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) {
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index ba2156242..1c5f8bb97 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -101,7 +101,7 @@ }
ob_start();
- foreach($viewlist as $view) {
+ foreach($viewlist as $priority => $view) {
if (!isset($CONFIG->views->locations[$view])) {
$location = $CONFIG->viewpath;
@@ -144,7 +144,7 @@ $CONFIG->views->extensions = array();
}
if (!isset($CONFIG->views->extensions[$view])) {
- $CONFIG->views[$view][500] = "{$view}";
+ $CONFIG->views->extensions[$view][500] = "{$view}";
}
while(isset($CONFIG->views->extensions[$view][$priority])) {
$priority++;
@@ -168,6 +168,8 @@ }
if (!isset($CONFIG->views->locations)) {
$CONFIG->views->locations = array($view => $location);
+ } else {
+ $CONFIG->views->locations[$view] = $location;
}
}
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 81f5757e9..a5027486d 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -25,8 +25,8 @@ if ($handle = opendir($CONFIG->pluginspath)) {
while ($mod = readdir($handle)) {
- if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($mod)) {
- if (!@include($ONFIG->pluginspath . $mod . "/start.php"))
+ if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) {
+ if (!@include($CONFIG->pluginspath . $mod . "/start.php"))
throw new PluginException("{$mod} is a misconfigured plugin.");
}
}
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql index 9b8304b80..9c0428ce7 100644 --- a/engine/schema/mysql.sql +++ b/engine/schema/mysql.sql @@ -14,7 +14,7 @@ -- Table structure for table `access_groups`
--
-CREATE TABLE `access_groups` (
+CREATE TABLE `prefix_access_groups` (
`id` int(11) NOT NULL,
`name` varchar(16) NOT NULL,
PRIMARY KEY (`id`),
@@ -25,7 +25,7 @@ CREATE TABLE `access_groups` ( -- Dumping data for table `access_groups`
--
-INSERT INTO `access_groups` (`id`, `name`) VALUES
+INSERT INTO `prefix_access_groups` (`id`, `name`) VALUES
(0, 'PRIVATE'),
(1, 'LOGGED_IN'),
(2, 'PUBLIC');
@@ -36,7 +36,7 @@ INSERT INTO `access_groups` (`id`, `name`) VALUES -- Table structure for table `access_group_membership`
--
-CREATE TABLE `access_group_membership` (
+CREATE TABLE `prefix_access_group_membership` (
`user_id` int(11) NOT NULL,
`access_group_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`access_group_id`)
@@ -49,7 +49,7 @@ CREATE TABLE `access_group_membership` ( -- Table structure for table `configuration`
--
-CREATE TABLE `configuration` (
+CREATE TABLE `prefix_configuration` (
`id` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`value` text NOT NULL,
@@ -64,7 +64,7 @@ CREATE TABLE `configuration` ( -- Table structure for table `metadata_type`
--
-CREATE TABLE `metadata_type` (
+CREATE TABLE `prefix_metadata_type` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
@@ -78,7 +78,7 @@ CREATE TABLE `metadata_type` ( -- Table structure for table `metadata_value`
--
-CREATE TABLE `metadata_value` (
+CREATE TABLE `prefix_metadata_value` (
`id` int(11) NOT NULL auto_increment,
`value` text NOT NULL,
PRIMARY KEY (`id`)
@@ -91,7 +91,7 @@ CREATE TABLE `metadata_value` ( -- Table structure for table `objects`
--
-CREATE TABLE `objects` (
+CREATE TABLE `prefix_objects` (
`id` int(11) NOT NULL auto_increment,
`owner_id` int(11) NOT NULL,
`site_id` int(11) NOT NULL,
@@ -110,7 +110,7 @@ CREATE TABLE `objects` ( -- Table structure for table `object_metadata`
--
-CREATE TABLE `object_metadata` (
+CREATE TABLE `prefix_object_metadata` (
`id` int(11) NOT NULL auto_increment,
`object_id` int(11) NOT NULL,
`metadata_type_id` int(11) NOT NULL,
@@ -127,7 +127,7 @@ CREATE TABLE `object_metadata` ( -- Table structure for table `object_types`
--
-CREATE TABLE `object_types` (
+CREATE TABLE `prefix_object_types` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(16) NOT NULL,
PRIMARY KEY (`id`),
@@ -140,7 +140,7 @@ CREATE TABLE `object_types` ( -- Table structure for table `users`
--
-CREATE TABLE `users` (
+CREATE TABLE `prefix_users` (
`id` int(11) NOT NULL auto_increment,
`name` text NOT NULL,
`username` varchar(12) NOT NULL default '',
@@ -165,7 +165,7 @@ CREATE TABLE `users` ( -- Table structure for table `user_metadata`
--
-CREATE TABLE `user_metadata` (
+CREATE TABLE `prefix_user_metadata` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`metadata_type_id` int(11) NOT NULL,
diff --git a/engine/settings.example.php b/engine/settings.example.php index 7c8b5019f..e45284685 100644 --- a/engine/settings.example.php +++ b/engine/settings.example.php @@ -33,6 +33,11 @@ // Database server
// (For most configurations, you can leave this as 'localhost')
$CONFIG->dbhost = "localhost";
+
+ // Database table prefix
+ // If you're sharing a database with other applications, you will want to use this
+ // to differentiate Elgg's tables.
+ $CONFIG->dbprefix = "elgg";
/*
* Multiple database connections
|