aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-11-19 01:20:22 +0100
committerIgor Wiedler <igor@wiedler.ch>2011-11-19 01:20:22 +0100
commitb7c4fb38de526eb446de20c0b8e54d7cf9108834 (patch)
treee5a09515fb73ca34e01736c681a733f40b2c89ba /phpBB/install
parent3df4b83cd3306013d78b93024905a67ecc97df25 (diff)
parent5f48f55cca5d0a6a2c51cdcc8a60b475354f50b1 (diff)
downloadforums-b7c4fb38de526eb446de20c0b8e54d7cf9108834.tar
forums-b7c4fb38de526eb446de20c0b8e54d7cf9108834.tar.gz
forums-b7c4fb38de526eb446de20c0b8e54d7cf9108834.tar.bz2
forums-b7c4fb38de526eb446de20c0b8e54d7cf9108834.tar.xz
forums-b7c4fb38de526eb446de20c0b8e54d7cf9108834.zip
Merge remote-tracking branch 'naderman/feature/extension-manager' into develop
* naderman/feature/extension-manager: (67 commits) [feature/extension-manager] Removing now unused acp_search code [feature/extension-manager] Split disabling extensions up into steps as well [feature/extension-manager] Add documentation on caching in ext finder [feature/extension-manager] Reference correct new module basenames in install [feature/extension-manager] Rename default methods to core methods on finder. [feature/extension-manager] Document what the class loader stores in cache [feature/extension-manager] Add docblock to cached paths map in class loader [feature/extension-manager] Clear up docs of extension related template changes [feature/extension-manager] Use "core files" instead of "global files" in docs [feature/extension-manager] Add docblocks to new search backend methods [feature/extension-manager] Add docblocks to new methods in functions_module [feature/extension-manager] Clarify comment on ext meta class instantiator [feature/extension-manager] Add more info on suffixes in extension finder [feature/extension-manager] Clarify is_dir parameter description [feature/extension-manager] Clarify class finding method docblock [feature/extension-manager] Correct default path comment & remove double strlen [feature/extension-manager] Fix "disbale" typo in comment [feature/extension-manager] Properly remove old ACP language loading code [feature/extension-manager] Support extensions in subdirectories of ext/ [feature/extension-manager] Add prefix to extension meta data / install classes ...
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php84
-rw-r--r--phpBB/install/index.php15
-rw-r--r--phpBB/install/install_install.php18
-rw-r--r--phpBB/install/schemas/firebird_schema.sql9
-rw-r--r--phpBB/install/schemas/mssql_schema.sql14
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql9
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql9
-rw-r--r--phpBB/install/schemas/oracle_schema.sql12
-rw-r--r--phpBB/install/schemas/postgres_schema.sql11
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql9
11 files changed, 171 insertions, 21 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 54737be627..255ea36aad 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -104,14 +104,21 @@ if (!defined('LOGIN_ATTEMPT_TABLE'))
{
define('LOGIN_ATTEMPT_TABLE', $table_prefix . 'login_attempts');
}
+if (!defined('EXT_TABLE'))
+{
+ define('EXT_TABLE', $table_prefix . 'ext');
+}
-$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
-$class_loader->register();
+$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx");
+$phpbb_class_loader_ext->register();
+$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx");
+$phpbb_class_loader->register();
// set up caching
$cache_factory = new phpbb_cache_factory($acm_type);
$cache = $cache_factory->get_service();
-$class_loader->set_cache($cache->get_driver());
+$phpbb_class_loader_ext->set_cache($cache->get_driver());
+$phpbb_class_loader->set_cache($cache->get_driver());
$request = new phpbb_request();
$user = new user();
@@ -671,7 +678,13 @@ function _write_result($no_updates, $errored, $error_ary)
function _add_modules($modules_to_install)
{
- global $phpbb_root_path, $phpEx, $db;
+ global $phpbb_root_path, $phpEx, $db, $phpbb_extension_manager;
+
+ // modules require an extension manager
+ if (empty($phpbb_extension_manager))
+ {
+ $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx");
+ }
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
@@ -1048,6 +1061,18 @@ function database_update_info()
// Changes from 3.1.0-dev to 3.1.0-A1
'3.1.0-dev' => array(
+ 'add_tables' => array(
+ EXT_TABLE => array(
+ 'COLUMNS' => array(
+ 'ext_name' => array('VCHAR', ''),
+ 'ext_active' => array('BOOL', 0),
+ 'ext_state' => array('TEXT', ''),
+ ),
+ 'KEYS' => array(
+ 'ext_name' => array('UNIQUE', 'ext_name'),
+ ),
+ ),
+ ),
'add_columns' => array(
GROUPS_TABLE => array(
'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
@@ -2095,8 +2120,49 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.1.0-dev to 3.1.0-A1
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');
+
+ // rename all module basenames to full classname
+ $sql = 'SELECT module_id, module_basename, module_class
+ FROM ' . MODULES_TABLE;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $module_id = (int) $row['module_id'];
+ unset($row['module_id']);
+
+ if (!empty($row['module_basename']) && !empty($row['module_class']))
+ {
+ // all the class names start with class name or with phpbb_ for auto loading
+ if (strpos($row['module_basename'], $row['module_class'] . '_') !== 0 &&
+ strpos($row['module_basename'], 'phpbb_') !== 0)
+ {
+ $row['module_basename'] = $row['module_class'] . '_' . $row['module_basename'];
+
+ $sql_update = $db->sql_build_array('UPDATE', $row);
+
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET ' . $sql_update . '
+ WHERE module_id = ' . $module_id;
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+ }
+
+ $db->sql_freeresult($result);
+
+ if (substr($config['search_type'], 0, 6) !== 'phpbb_')
+ {
+ // try to guess the new auto loaded search class name
+ // works for native and mysql fulltext
+ set_config('search_type', 'phpbb_search_' . $config['search_type']);
+ }
+
+ if (!isset($config['load_jquery_cdn']))
+ {
+ set_config('load_jquery_cdn', 0);
+ set_config('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
+ }
if (!isset($config['use_system_cron']))
{
@@ -2163,14 +2229,14 @@ function change_database_data(&$no_updates, $version)
// Install modules
$modules_to_install = array(
'position' => array(
- 'base' => 'groups',
+ 'base' => 'acp_groups',
'class' => 'acp',
'title' => 'ACP_GROUPS_POSITION',
'auth' => 'acl_a_group',
'cat' => 'ACP_GROUPS',
),
'manage' => array(
- 'base' => 'attachments',
+ 'base' => 'acp_attachments',
'class' => 'acp',
'title' => 'ACP_MANAGE_ATTACHMENTS',
'auth' => 'acl_a_attach',
@@ -2179,7 +2245,7 @@ function change_database_data(&$no_updates, $version)
);
_add_modules($modules_to_install);
-
+
$sql = 'DELETE FROM ' . MODULES_TABLE . "
WHERE module_basename = 'styles' AND module_mode = 'imageset'";
_sql($sql, $errored, $error_ary);
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index a4ff93e701..abe5d1e485 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -82,13 +82,16 @@ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
-$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
-$class_loader->register();
+$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx");
+$phpbb_class_loader_ext->register();
+$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx");
+$phpbb_class_loader->register();
// set up caching
$cache_factory = new phpbb_cache_factory('file');
$cache = $cache_factory->get_service();
-$class_loader->set_cache($cache->get_driver());
+$phpbb_class_loader_ext->set_cache($cache->get_driver());
+$phpbb_class_loader->set_cache($cache->get_driver());
$request = new phpbb_request();
@@ -199,8 +202,10 @@ $config = new phpbb_config(array(
'load_tplcompile' => '1'
));
-$template_locator = new phpbb_template_locator();
-$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator);
+$phpbb_template_locator = new phpbb_template_locator();
+$phpbb_template_path_provider = new phpbb_template_path_provider();
+$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider);
+$template->set_ext_dir_prefix('adm/');
$template->set_custom_template('../adm/style', 'admin');
$template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', '../adm/style');
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 722b5ddebd..0e0cbf5ae5 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1445,7 +1445,7 @@ class install_install extends module
set_config_count(null, null, null, $config);
$error = false;
- $search = new fulltext_native($error);
+ $search = new phpbb_search_fulltext_native($error);
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
FROM ' . POSTS_TABLE;
@@ -1463,7 +1463,13 @@ class install_install extends module
*/
function add_modules($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx;
+ global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager;
+
+ // modules require an extension manager
+ if (empty($phpbb_extension_manager))
+ {
+ $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx");
+ }
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
@@ -1578,7 +1584,7 @@ class install_install extends module
// Move main module 4 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'main'
+ WHERE module_basename = 'acp_main'
AND module_class = 'acp'
AND module_mode = 'main'";
$result = $db->sql_query($sql);
@@ -1590,7 +1596,7 @@ class install_install extends module
// Move permissions intro screen module 4 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'permissions'
+ WHERE module_basename = 'acp_permissions'
AND module_class = 'acp'
AND module_mode = 'intro'";
$result = $db->sql_query($sql);
@@ -1602,7 +1608,7 @@ class install_install extends module
// Move manage users screen module 5 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'users'
+ WHERE module_basename = 'acp_users'
AND module_class = 'acp'
AND module_mode = 'overview'";
$result = $db->sql_query($sql);
@@ -1617,7 +1623,7 @@ class install_install extends module
// Move attachment module 4 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'attachments'
+ WHERE module_basename = 'ucp_attachments'
AND module_class = 'ucp'
AND module_mode = 'attachments'";
$result = $db->sql_query($sql);
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index a23416e122..daeba45864 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -282,6 +282,15 @@ BEGIN
END;;
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ ext_active INTEGER DEFAULT 0 NOT NULL,
+ ext_state BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext(ext_name);;
+
# Table: 'phpbb_extensions'
CREATE TABLE phpbb_extensions (
extension_id INTEGER NOT NULL,
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 8826b52b84..736917fdcb 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -361,6 +361,20 @@ GO
/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE [phpbb_ext] (
+ [ext_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [ext_active] [int] DEFAULT (0) NOT NULL ,
+ [ext_state] [varchar] (8000) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [ext_name] ON [phpbb_ext]([ext_name]) ON [PRIMARY]
+GO
+
+
+/*
Table: 'phpbb_extensions'
*/
CREATE TABLE [phpbb_extensions] (
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index caed98dfd2..97c378621b 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -192,6 +192,15 @@ CREATE TABLE phpbb_drafts (
);
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varbinary(255) DEFAULT '' NOT NULL,
+ ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ext_state blob NOT NULL,
+ UNIQUE ext_name (ext_name)
+);
+
+
# Table: 'phpbb_extensions'
CREATE TABLE phpbb_extensions (
extension_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 0793df590d..9615905625 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -192,6 +192,15 @@ CREATE TABLE phpbb_drafts (
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) DEFAULT '' NOT NULL,
+ ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ext_state text NOT NULL,
+ UNIQUE ext_name (ext_name)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
# Table: 'phpbb_extensions'
CREATE TABLE phpbb_extensions (
extension_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 aa229fde9f..5d60d2a19e 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -410,6 +410,18 @@ END;
/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE phpbb_ext (
+ ext_name varchar2(255) DEFAULT '' ,
+ ext_active number(1) DEFAULT '0' NOT NULL,
+ ext_state clob DEFAULT '' ,
+ CONSTRAINT u_phpbb_ext_name UNIQUE (ext_name)
+)
+/
+
+
+/*
Table: 'phpbb_extensions'
*/
CREATE TABLE phpbb_extensions (
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index b3c645ecef..d7377ac2e6 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -315,6 +315,17 @@ CREATE TABLE phpbb_drafts (
CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) DEFAULT '' NOT NULL,
+ ext_active INT2 DEFAULT '0' NOT NULL CHECK (ext_active >= 0),
+ ext_state varchar(8000) DEFAULT '' NOT NULL
+);
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
+
+/*
Table: 'phpbb_extensions'
*/
CREATE SEQUENCE phpbb_extensions_seq;
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 8f61a90de5..3255cafea2 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -226,7 +226,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'fulltext_native');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'phpbb_search_fulltext_native');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1');
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 6875411bfc..257937275c 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -187,6 +187,15 @@ CREATE TABLE phpbb_drafts (
CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) NOT NULL DEFAULT '',
+ ext_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ext_state text(65535) NOT NULL DEFAULT ''
+);
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
+
# Table: 'phpbb_extensions'
CREATE TABLE phpbb_extensions (
extension_id INTEGER PRIMARY KEY NOT NULL ,