aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-16 16:54:51 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-16 16:54:51 +0000
commitb0c3e3958220c04cbb4f25f0c24b53b65a34e360 (patch)
tree6c23cb4352a297b4dade2b3a1aa6706b89a53c82 /phpBB/install
parenta3c9182e0f9efeb193f5ef682d1945382f234eb3 (diff)
downloadforums-b0c3e3958220c04cbb4f25f0c24b53b65a34e360.tar
forums-b0c3e3958220c04cbb4f25f0c24b53b65a34e360.tar.gz
forums-b0c3e3958220c04cbb4f25f0c24b53b65a34e360.tar.bz2
forums-b0c3e3958220c04cbb4f25f0c24b53b65a34e360.tar.xz
forums-b0c3e3958220c04cbb4f25f0c24b53b65a34e360.zip
- removed db cache (might re-appear, but for now we do not see the need for it)
- all changes to styles/subsilver/template are purely cosmetic (no functional changes) - cosmetics - bugfixes - add index to modules table - use modules ordering code for forums too git-svn-id: file:///svn/phpbb/trunk@6073 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rwxr-xr-xphpBB/install/index.php36
-rwxr-xr-xphpBB/install/install_install.php92
-rwxr-xr-xphpBB/install/install_main.php17
-rw-r--r--phpBB/install/schemas/firebird_schema.sql11
-rw-r--r--phpBB/install/schemas/mssql_schema.sql26
-rw-r--r--phpBB/install/schemas/mysql_schema.sql11
-rw-r--r--phpBB/install/schemas/oracle_schema.sql14
-rw-r--r--phpBB/install/schemas/postgres_schema.sql14
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql10
9 files changed, 86 insertions, 145 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index a71d6c9da5..b2e36cd047 100755
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -97,13 +97,13 @@ else
@set_time_limit(120);
// Include essential scripts
-require($phpbb_root_path . 'includes/functions.'.$phpEx);
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
include($phpbb_root_path . 'includes/auth.' . $phpEx);
-include($phpbb_root_path . 'includes/session.'.$phpEx);
-include($phpbb_root_path . 'includes/template.'.$phpEx);
-include($phpbb_root_path . 'includes/acm/acm_file.'.$phpEx);
-include($phpbb_root_path . 'includes/cache.'.$phpEx);
-include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
+include($phpbb_root_path . 'includes/session.' . $phpEx);
+include($phpbb_root_path . 'includes/template.' . $phpEx);
+include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
+include($phpbb_root_path . 'includes/cache.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
// Try and load an appropriate language if required
$language = request_var('language', '');
@@ -152,11 +152,11 @@ if (!$language)
}
// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.'.$phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.'.$phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/board.'.$phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.'.$phpEx);
-include($phpbb_root_path . 'language/' . $language . '/posting.'.$phpEx);
+include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
+include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
+include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx);
+include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
+include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx);
$mode = request_var('mode', 'overview');
$sub = request_var('sub', '');
@@ -201,7 +201,9 @@ class module
var $mode;
var $sub;
- // Private methods, should not be overwritten
+ /**
+ * Private methods, should not be overwritten
+ */
function create($module_type, $module_url, $selected_mod = false, $selected_submod = false)
{
global $db, $config, $phpEx;
@@ -263,7 +265,9 @@ class module
} // END foreach
} // END create
- // Load and run the relevant module if applicable
+ /**
+ * Load and run the relevant module if applicable
+ */
function load($mode = false, $run = true)
{
global $phpbb_root_path, $phpEx;
@@ -275,13 +279,16 @@ class module
$this->mode = $mode;
}
+ /**
+ * @todo this could be written as $this->module = new $this->filename($this); ... no? (eval statement in install/index.php)
+ */
eval("\$this->module = new $this->filename(\$this);");
if (method_exists($this->module, 'main'))
{
$this->module->main($this->mode, $this->sub);
}
}
- } // END load
+ }
/**
* Output the standard page header
@@ -598,4 +605,5 @@ class module
return $tpl;
}
}
+
?> \ No newline at end of file
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 486e89b233..8fc1c3d7b5 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -14,13 +14,13 @@
if (!empty($setmodules))
{
$module[] = array(
- 'module_type' => 'install',
- 'module_title' => 'INSTALL',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
- 'module_order' => 10,
- 'module_subs' => '',
- 'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'FINAL'),
- 'module_reqs' => ''
+ 'module_type' => 'install',
+ 'module_title' => 'INSTALL',
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_order' => 10,
+ 'module_subs' => '',
+ 'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'FINAL'),
+ 'module_reqs' => ''
);
}
@@ -124,6 +124,7 @@ class install_install extends module
else
{
$passed['php'] = true;
+
// We also give feedback on whether we're running in safe mode
$result = '<b style="color:green">' . $lang['YES'];
if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on')
@@ -132,6 +133,7 @@ class install_install extends module
}
$result .= '</b>';
}
+
$template->assign_block_vars('checks', array(
'TITLE' => $lang['PHP_VERSION_REQD'],
'RESULT' => $result,
@@ -173,7 +175,7 @@ class install_install extends module
{
$dll = $db_ary['MODULE'];
- if (!extension_loaded($dll))
+ if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -208,7 +210,7 @@ class install_install extends module
foreach ($this->php_dlls_other as $dll)
{
- if (!extension_loaded($dll))
+ if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -222,6 +224,7 @@ class install_install extends module
continue;
}
}
+
$template->assign_block_vars('checks', array(
'TITLE' => $lang['DLL_' . strtoupper($dll)],
'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>',
@@ -429,7 +432,7 @@ class install_install extends module
$available_dbms_temp = array();
foreach ($this->available_dbms as $type => $dbms_ary)
{
- if (!extension_loaded($dbms_ary['MODULE']))
+ if (!@extension_loaded($dbms_ary['MODULE']))
{
if (!$this->can_load_dll($dbms_ary['MODULE']))
{
@@ -693,7 +696,7 @@ class install_install extends module
foreach ($check_exts as $dll)
{
- if (!extension_loaded($dll))
+ if (!@extension_loaded($dll))
{
if (!$this->can_load_dll($dll))
{
@@ -907,7 +910,7 @@ class install_install extends module
$cookie_domain = ($server_name != '') ? $server_name : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
// If we get here and the extension isn't loaded it should be safe to just go ahead and load it
- if (!extension_loaded($this->available_dbms[$dbms]['MODULE']))
+ if (!@extension_loaded($this->available_dbms[$dbms]['MODULE']))
{
@dl($this->available_dbms[$dbms]['MODULE'] . ".$prefix");
}
@@ -1264,34 +1267,28 @@ class install_install extends module
if ($module_class == 'acp')
{
// Move main module 4 up...
- for ($i = 1; $i <= 4; $i++)
- {
- $sql = 'SELECT *
- FROM ' . MODULES_TABLE . "
- WHERE module_name = 'main'
- AND module_class = 'acp'
- AND module_mode = 'main'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_name = 'main'
+ AND module_class = 'acp'
+ AND module_mode = 'main'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 1);
- }
+ $_module->move_module_by($row, 'move_up', 4);
// Move permissions intro screen module 4 up...
- for ($i = 1; $i <= 4; $i++)
- {
- $sql = 'SELECT *
- FROM ' . MODULES_TABLE . "
- WHERE module_name = 'permissions'
- AND module_class = 'acp'
- AND module_mode = 'intro'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_name = 'permissions'
+ AND module_class = 'acp'
+ AND module_mode = 'intro'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 1);
- }
+ $_module->move_module_by($row, 'move_up', 4);
}
// And now for the special ones
@@ -1374,7 +1371,7 @@ class install_install extends module
foreach ($this->bot_list as $bot_name => $bot_ary)
{
$user_row = array(
- 'user_type' => GROUP_HIDDEN,
+ 'user_type' => USER_IGNORE,
'group_id' => $group_id,
'username' => $bot_name,
'user_regdate' => time(),
@@ -1446,7 +1443,7 @@ class install_install extends module
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
+ include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
@@ -1523,23 +1520,23 @@ class install_install extends module
case 'sqlite':
$sql = "SHOW TABLES";
$field = "Tables_in_{$dbname}";
- break;
+ break;
case 'mssql':
case 'mssql_odbc':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
- $field = "name";
- break;
+ $field = 'name';
+ break;
case 'postgres':
$sql = "SELECT relname
FROM pg_class
WHERE relkind = 'r'
AND relname NOT LIKE 'pg\_%'";
- $field = "relname";
- break;
+ $field = 'relname';
+ break;
case 'firebird':
$sql = 'SELECT rdb$relation_name
@@ -1547,12 +1544,12 @@ class install_install extends module
WHERE rdb$view_source is null
AND rdb$system_flag = 0';
$field = 'rdb$relation_name';
- break;
+ break;
case 'oracle':
$sql = 'SELECT table_name FROM USER_TABLES';
$field = 'table_name';
- break;
+ break;
}
$result = $db->sql_query($sql);
@@ -1563,8 +1560,7 @@ class install_install extends module
do
{
- // All phpBB installations will at least have config else it won't
- // work
+ // All phpBB installations will at least have config else it won't work
if (in_array(strtolower($row[$field]), $table_ary))
{
$error[] = $lang['INST_ERR_PREFIX'];
@@ -1612,7 +1608,7 @@ class install_install extends module
{
$path = $phpbb_root_path . 'language/' . $file;
- if (is_file($path) || is_link($path) || $file == '.' || $file == '..')
+ if (is_file($path) || is_link($path) || $file == '.' || $file == '..' || $file == 'CVS')
{
continue;
}
diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php
index 1960db93c8..80516a895f 100755
--- a/phpBB/install/install_main.php
+++ b/phpBB/install/install_main.php
@@ -14,13 +14,13 @@
if (!empty($setmodules))
{
$module[] = array(
- 'module_type' => 'install',
- 'module_title' => 'OVERVIEW',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
- 'module_order' => 0,
- 'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'),
- 'module_stages' => '',
- 'module_reqs' => ''
+ 'module_type' => 'install',
+ 'module_title' => 'OVERVIEW',
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_order' => 0,
+ 'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'),
+ 'module_stages' => '',
+ 'module_reqs' => ''
);
}
@@ -45,10 +45,12 @@ class install_main extends module
$title = $lang['SUB_INTRO'];
$body = $lang['OVERVIEW_BODY'];
break;
+
case 'license' :
$title = $lang['GPL'];
$body = implode("<br/>\n", file('../docs/COPYING'));
break;
+
case 'support' :
$title = $lang['SUB_SUPPORT'];
$body = $lang['SUPPORT_BODY'];
@@ -64,4 +66,5 @@ class install_main extends module
));
}
}
+
?> \ No newline at end of file
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index e74dff0f22..a505ed9578 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -204,16 +204,6 @@ BEGIN
END;;
-# phpbb_cache
-CREATE TABLE phpbb_cache (
- var_name VARCHAR(252) NOT NULL,
- var_expires INTEGER DEFAULT 0 NOT NULL,
- var_data BLOB SUB_TYPE TEXT
-);;
-
-ALTER TABLE phpbb_cache ADD PRIMARY KEY (var_name);;
-
-
# phpbb_config
CREATE TABLE phpbb_config (
config_name VARCHAR(252) NOT NULL,
@@ -565,6 +555,7 @@ ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
CREATE GENERATOR phpbb_modules_gen;;
SET GENERATOR phpbb_modules_gen TO 0;;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 937c9bf77b..72db08a523 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -330,29 +330,6 @@ GO
/*
- Table: phpbb_cache
-*/
-CREATE TABLE [phpbb_cache] (
- [var_name] [varchar] (255) NOT NULL ,
- [var_expires] [int] NOT NULL ,
- [var_data] [text]
-) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_cache] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_cache] PRIMARY KEY CLUSTERED
- (
- [var_name]
- ) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_cache] WITH NOCHECK ADD
- CONSTRAINT [DF_phpbb_cache__var_expires] DEFAULT (0) FOR [var_expires],
- CONSTRAINT [DF_phpbb_cache__var_name] DEFAULT ('') FOR [var_name]
-GO
-
-
-/*
Table: phpbb_config
*/
CREATE TABLE [phpbb_config] (
@@ -895,6 +872,9 @@ GO
CREATE INDEX [module_left_right_id] ON [phpbb_modules]([left_id], [right_id]) ON [PRIMARY]
GO
+CREATE INDEX [module_class_left_id] ON [phpbb_modules]([module_class], [left_id]) ON [PRIMARY]
+GO
+
/*
Table: phpbb_poll_options
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index f03f704820..88d02429ef 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -132,14 +132,6 @@ CREATE TABLE phpbb_bots (
KEY bot_active (bot_active)
);
-# Table: 'phpbb_cache'
-CREATE TABLE phpbb_cache (
- var_name varchar(255) DEFAULT '' NOT NULL,
- var_expires int(10) UNSIGNED DEFAULT '0' NOT NULL,
- var_data mediumtext,
- PRIMARY KEY (var_name)
-);
-
# Table: 'phpbb_config'
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -362,7 +354,8 @@ CREATE TABLE phpbb_modules (
module_auth varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (module_id),
KEY left_right_id (left_id, right_id),
- KEY module_enabled (module_enabled)
+ KEY module_enabled (module_enabled),
+ KEY class_left_id (module_class, left_id)
);
# Table: 'phpbb_poll_options'
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 0137f98f5a..900232b79a 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -308,18 +308,6 @@ CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active)
/*
- Table: phpbb_cache
-*/
-CREATE TABLE phpbb_cache (
- var_name varchar2(255) DEFAULT '',
- var_expires number(10) DEFAULT '0' NOT NULL,
- var_data clob,
- CONSTRAINT pk_phpbb_cache PRIMARY KEY (var_name)
-)
-/
-
-
-/*
Table: phpbb_config
*/
CREATE TABLE phpbb_config (
@@ -781,6 +769,8 @@ CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled)
/
CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id)
/
+CREATE INDEX phpbb_modules_class_left_id on phpbb_modules (module_class, left_id)
+/
/*
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index d24cefacc7..f52d6fe278 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -254,18 +254,6 @@ CREATE TABLE phpbb_bots (
CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
-
-
-/* Table: phpbb_cache */
-CREATE TABLE phpbb_cache (
- var_name varchar(255) DEFAULT '' NOT NULL,
- var_expires INT4 DEFAULT '0' NOT NULL,
- var_data TEXT,
- PRIMARY KEY (var_name),
- CHECK (var_expires>=0)
-);
-
-
/* Table: phpbb_config */
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -590,7 +578,7 @@ CREATE TABLE phpbb_modules (
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
-
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index c989bbd1ef..04394f2d4a 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -146,15 +146,6 @@ CREATE TABLE phpbb_bots (
CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active);
-# Table: phpbb_cache
-CREATE TABLE phpbb_cache (
- var_name varchar(255) NOT NULL DEFAULT '',
- var_expires int(10) NOT NULL DEFAULT '0',
- var_data mediumtext(16777215),
- PRIMARY KEY (var_name)
-);
-
-
# Table: phpbb_config
CREATE TABLE phpbb_config (
config_name varchar(255) NOT NULL,
@@ -392,6 +383,7 @@ CREATE TABLE phpbb_modules (
CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled);
CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id);
+CREATE INDEX phpbb_modules_class_left_id on phpbb_modules (module_class, left_id);
# Table: phpbb_poll_options