aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/migration
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2013-02-28 11:19:30 -0500
committerDavid King <imkingdavid@gmail.com>2013-02-28 11:19:30 -0500
commit1eead4da97635df35bfcdd6b1ce7ed71d9851d41 (patch)
tree3a11046577543b57b0c217b116865255feae6b4e /phpBB/includes/db/migration
parentb1735e30bd8e377bbdd5d305cd838339b0af2bf9 (diff)
parentc3434dec4020e1053f40382cdec729316f901728 (diff)
downloadforums-1eead4da97635df35bfcdd6b1ce7ed71d9851d41.tar
forums-1eead4da97635df35bfcdd6b1ce7ed71d9851d41.tar.gz
forums-1eead4da97635df35bfcdd6b1ce7ed71d9851d41.tar.bz2
forums-1eead4da97635df35bfcdd6b1ce7ed71d9851d41.tar.xz
forums-1eead4da97635df35bfcdd6b1ce7ed71d9851d41.zip
Merge remote-tracking branch 'EXreaction/ticket/11363' into develop
# By Nathaniel Guse # Via Nathaniel Guse * EXreaction/ticket/11363: [ticket/11363] Fix a couple bugs and throw errors if the file not found [ticket/11363] Load module info files for extensions too
Diffstat (limited to 'phpBB/includes/db/migration')
-rw-r--r--phpBB/includes/db/migration/tool/module.php45
1 files changed, 17 insertions, 28 deletions
diff --git a/phpBB/includes/db/migration/tool/module.php b/phpBB/includes/db/migration/tool/module.php
index 4d7fae2bb0..8744866a16 100644
--- a/phpBB/includes/db/migration/tool/module.php
+++ b/phpBB/includes/db/migration/tool/module.php
@@ -183,26 +183,20 @@ 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))
+ if (!class_exists('acp_modules'))
{
- throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $info_file);
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
}
+ $acp_modules = new acp_modules();
+ $module = $acp_modules->get_module_infos($basename, $class);
+ $module = $module[$basename];
+ unset($acp_modules);
- $classname = "{$basename}_info";
-
- if (!class_exists($classname))
+ if (empty($module))
{
- include($include_path . $info_file);
+ throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename);
}
- $info = new $classname;
- $module = $info->module();
- unset($info);
-
$result = '';
foreach ($module['modes'] as $mode => $module_info)
{
@@ -373,30 +367,25 @@ 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))
+ if (!class_exists('acp_modules'))
{
- throw new phpbb_db_migration_exception('MODULE_NOT_EXIST', $info_file);
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
}
+ $acp_modules = new acp_modules();
+ $module_info = $acp_modules->get_module_infos($basename, $class);
+ $module_info = $module_info[$basename];
+ unset($acp_modules);
- $classname = "{$basename}_info";
-
- if (!class_exists($classname))
+ if (empty($module_info))
{
- include($include_path . $info_file);
+ throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename);
}
- $info = new $classname;
- $module_info = $info->module();
- unset($info);
-
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']);
}
}
}