aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-02-27 11:12:18 -0600
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-02-27 11:12:18 -0600
commitd296e809d5e44eec0005ed8229d5a173cd4f6edb (patch)
treeb9056ad7bfbbf33b116e3ef6e6d0b074ad116151 /phpBB/includes/db
parent80bd78a5e5e1069773c05073cd47662a311bda79 (diff)
downloadforums-d296e809d5e44eec0005ed8229d5a173cd4f6edb.tar
forums-d296e809d5e44eec0005ed8229d5a173cd4f6edb.tar.gz
forums-d296e809d5e44eec0005ed8229d5a173cd4f6edb.tar.bz2
forums-d296e809d5e44eec0005ed8229d5a173cd4f6edb.tar.xz
forums-d296e809d5e44eec0005ed8229d5a173cd4f6edb.zip
[ticket/11363] Load module info files for extensions too
Use the acp_modules::get_module_infos function instead of our own include code PHPBB3-11363
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/migration/tool/module.php45
1 files changed, 11 insertions, 34 deletions
diff --git a/phpBB/includes/db/migration/tool/module.php b/phpBB/includes/db/migration/tool/module.php
index 4d7fae2bb0..994768598c 100644
--- a/phpBB/includes/db/migration/tool/module.php
+++ b/phpBB/includes/db/migration/tool/module.php
@@ -183,25 +183,13 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac
$basename = str_replace(array('/', '\\'), '', $basename);
$class = str_replace(array('/', '\\'), '', $class);
- $include_path = ($include_path === false) ? $this->phpbb_root_path . 'includes/' : $include_path;
- $info_file = "$class/info/$basename.{$this->php_ext}";
-
- // The manual and automatic ways both failed...
- if (!file_exists($include_path . $info_file))
- {
- throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $info_file);
- }
-
- $classname = "{$basename}_info";
-
- if (!class_exists($classname))
+ if (!class_exists('acp_modules'))
{
- include($include_path . $info_file);
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
}
-
- $info = new $classname;
- $module = $info->module();
- unset($info);
+ $acp_modules = new acp_modules();
+ $module = $acp_modules->get_module_infos($basename, $class);
+ unset($acp_modules);
$result = '';
foreach ($module['modes'] as $mode => $module_info)
@@ -373,30 +361,19 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac
$basename = str_replace(array('/', '\\'), '', $module['module_basename']);
$class = str_replace(array('/', '\\'), '', $class);
- $include_path = ($include_path === false) ? $this->phpbb_root_path . 'includes/' : $include_path;
- $info_file = "$class/info/$basename.{$this->php_ext}";
-
- if (!file_exists($include_path . $info_file))
- {
- throw new phpbb_db_migration_exception('MODULE_NOT_EXIST', $info_file);
- }
-
- $classname = "{$basename}_info";
-
- if (!class_exists($classname))
+ if (!class_exists('acp_modules'))
{
- include($include_path . $info_file);
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
}
-
- $info = new $classname;
- $module_info = $info->module();
- unset($info);
+ $acp_modules = new acp_modules();
+ $module_info = $acp_modules->get_module_infos($basename, $class);
+ unset($acp_modules);
foreach ($module_info['modes'] as $mode => $info)
{
if (!isset($module['modes']) || in_array($mode, $module['modes']))
{
- $this->remove($class, $parent, $info['title']) . '<br />';
+ $this->remove($class, $parent, $info['title']);
}
}
}