aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php84
-rw-r--r--phpBB/install/install_install.php27
-rw-r--r--phpBB/install/schemas/firebird_schema.sql7
-rw-r--r--phpBB/install/schemas/mssql_schema.sql12
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql7
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql7
-rw-r--r--phpBB/install/schemas/oracle_schema.sql10
-rw-r--r--phpBB/install/schemas/postgres_schema.sql10
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql7
9 files changed, 93 insertions, 78 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 1fa01a534d..4c588f49cd 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2092,42 +2092,69 @@ function change_database_data(&$no_updates, $version)
case '3.1.0-dev':
set_config('load_jquery_cdn', 0);
set_config('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
- set_config('use_system_cron', 0);
- $sql = 'UPDATE ' . GROUPS_TABLE . '
- SET group_teampage = 1
- WHERE group_type = ' . GROUP_SPECIAL . "
- AND group_name = 'ADMINISTRATORS'";
- _sql($sql, $errored, $error_ary);
-
- $sql = 'UPDATE ' . GROUPS_TABLE . '
- SET group_teampage = 2
- WHERE group_type = ' . GROUP_SPECIAL . "
- AND group_name = 'GLOBAL_MODERATORS'";
- _sql($sql, $errored, $error_ary);
-
- set_config('legend_sort_groupname', '0');
- set_config('teampage_multiple', '1');
- set_config('teampage_forums', '1');
+ if (!isset($config['use_system_cron']))
+ {
+ set_config('use_system_cron', 0);
+ }
- $sql = 'SELECT group_id
+ $sql = 'SELECT group_teampage
FROM ' . GROUPS_TABLE . '
- WHERE group_legend = 1
- ORDER BY group_name ASC';
- $result = $db->sql_query($sql);
+ WHERE group_teampage > 0';
+ $result = $db->sql_query_limit($sql, 1);
+ $added_groups_teampage = (bool) $db->sql_fetchfield('group_teampage');
+ $db->sql_freeresult($result);
- $next_legend = 1;
- while ($row = $db->sql_fetchrow($result))
+ if (!$added_groups_teampage)
{
$sql = 'UPDATE ' . GROUPS_TABLE . '
- SET group_legend = ' . $next_legend . '
- WHERE group_id = ' . (int) $row['group_id'];
+ SET group_teampage = 1
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'ADMINISTRATORS'";
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 2
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'GLOBAL_MODERATORS'";
_sql($sql, $errored, $error_ary);
+ }
- $next_legend++;
+ if (!isset($config['use_system_cron']))
+ {
+ set_config('legend_sort_groupname', '0');
+ set_config('teampage_multiple', '1');
+ set_config('teampage_forums', '1');
}
+
+ $sql = 'SELECT group_legend
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_teampage > 1';
+ $result = $db->sql_query_limit($sql, 1);
+ $updated_group_legend = (bool) $db->sql_fetchfield('group_teampage');
$db->sql_freeresult($result);
- unset($next_legend);
+
+ if (!$updated_group_legend)
+ {
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_legend = 1
+ ORDER BY group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $next_legend = 1;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . $next_legend . '
+ WHERE group_id = ' . (int) $row['group_id'];
+ _sql($sql, $errored, $error_ary);
+
+ $next_legend++;
+ }
+ $db->sql_freeresult($result);
+ unset($next_legend);
+ }
// Install modules
$modules_to_install = array(
@@ -2231,7 +2258,10 @@ function change_database_data(&$no_updates, $version)
}
// Allow custom profile fields in pm templates
- set_config('load_cpf_pm', '0');
+ if (!isset($config['load_cpf_pm']))
+ {
+ set_config('load_cpf_pm', '0');
+ }
$no_updates = false;
break;
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index f8c54678bf..439bebf27e 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -876,33 +876,8 @@ class install_install extends module
@chmod($phpbb_root_path . 'cache/install_lock', 0777);
- $load_extensions = implode(',', $load_extensions);
-
// Time to convert the data provided into a config file
- $config_data = "<?php\n";
- $config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n";
-
- $config_data_array = array(
- 'dbms' => $available_dbms[$data['dbms']]['DRIVER'],
- 'dbhost' => $data['dbhost'],
- 'dbport' => $data['dbport'],
- 'dbname' => $data['dbname'],
- 'dbuser' => $data['dbuser'],
- 'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']),
- 'table_prefix' => $data['table_prefix'],
- 'acm_type' => 'file',
- 'load_extensions' => $load_extensions,
- );
-
- foreach ($config_data_array as $key => $value)
- {
- $config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n";
- }
- unset($config_data_array);
-
- $config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
- $config_data .= "// @define('DEBUG', true);\n";
- $config_data .= "// @define('DEBUG_EXTRA', true);\n";
+ $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions);
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 67e5547bb6..a23416e122 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index fe69670ded..8826b52b84 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
/*
Table: 'phpbb_attachments'
@@ -1307,7 +1309,7 @@ CREATE TABLE [phpbb_styles] (
[style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[style_active] [int] DEFAULT (1) NOT NULL ,
[template_id] [int] DEFAULT (0) NOT NULL ,
- [theme_id] [int] DEFAULT (0) NOT NULL
+ [theme_id] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index da6ce35be3..caed98dfd2 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index cdbe377178..0793df590d 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 8797457e87..aa229fde9f 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
/*
This first section is optional, however its probably the best method
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 3c79aacd6b..b3c645ecef 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
BEGIN;
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index e0631160fd..6875411bfc 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
BEGIN TRANSACTION;
# Table: 'phpbb_attachments'