aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-29 20:54:42 -0400
committerNils Adermann <naderman@naderman.de>2011-09-29 15:42:49 +0200
commitfe4b8818ec1f448d5625534e5027cfbc1177ab9a (patch)
treed97f32577cc84f26161b7634ebae17da6c4f1f74 /phpBB/install/database_update.php
parentc785ef7aa7953c5e533e48b11ef13d6b1f344813 (diff)
downloadforums-fe4b8818ec1f448d5625534e5027cfbc1177ab9a.tar
forums-fe4b8818ec1f448d5625534e5027cfbc1177ab9a.tar.gz
forums-fe4b8818ec1f448d5625534e5027cfbc1177ab9a.tar.bz2
forums-fe4b8818ec1f448d5625534e5027cfbc1177ab9a.tar.xz
forums-fe4b8818ec1f448d5625534e5027cfbc1177ab9a.zip
[feature/extension-manager] Always store the full class name as module basename
The updater swaps out all basenames. PHPBB3-10323
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php35
1 files changed, 33 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 2635396af0..221f6b1344 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2115,6 +2115,37 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':
+
+ // 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);
+
// 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']);
@@ -2159,14 +2190,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',