diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-03-02 14:48:44 -0600 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-03-02 14:48:44 -0600 |
commit | 59638a6a7d873b8ec5b9b2e9e72fdf693bde260a (patch) | |
tree | a5f2fd9cd7ca5c12b0ad2b12da492458a83dcf09 /phpBB/includes/db | |
parent | a6f877c0d84ff102d3812246eae7469e191983e2 (diff) | |
parent | 4670ffe90c221ffc65d9ecca8a98e2bdc888a258 (diff) | |
download | forums-59638a6a7d873b8ec5b9b2e9e72fdf693bde260a.tar forums-59638a6a7d873b8ec5b9b2e9e72fdf693bde260a.tar.gz forums-59638a6a7d873b8ec5b9b2e9e72fdf693bde260a.tar.bz2 forums-59638a6a7d873b8ec5b9b2e9e72fdf693bde260a.tar.xz forums-59638a6a7d873b8ec5b9b2e9e72fdf693bde260a.zip |
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/11386
Conflicts:
phpBB/includes/extension/finder.php
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/migration/tool/module.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/phpBB/includes/db/migration/tool/module.php b/phpBB/includes/db/migration/tool/module.php index 8744866a16..6ffb073543 100644 --- a/phpBB/includes/db/migration/tool/module.php +++ b/phpBB/includes/db/migration/tool/module.php @@ -183,19 +183,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac $basename = str_replace(array('/', '\\'), '', $basename); $class = str_replace(array('/', '\\'), '', $class); - if (!class_exists('acp_modules')) - { - 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); - - if (empty($module)) - { - throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); - } + $module = $this->get_module_info($class, $basename); $result = ''; foreach ($module['modes'] as $mode => $module_info) @@ -367,19 +355,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac $basename = str_replace(array('/', '\\'), '', $module['module_basename']); $class = str_replace(array('/', '\\'), '', $class); - if (!class_exists('acp_modules')) - { - 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); - - if (empty($module_info)) - { - throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); - } + $module_info = $this->get_module_info($class, $basename); foreach ($module_info['modes'] as $mode => $info) { @@ -499,4 +475,28 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac return call_user_func_array(array(&$this, $call), $arguments); } } + + /** + * Wrapper for acp_modules::get_module_infos() + * + * @param string $class Module Class + * @param string $basename Module Basename + * @return array Module Information + */ + protected function get_module_info($class, $basename) + { + if (!class_exists('acp_modules')) + { + 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, true); + + if (empty($module)); + { + throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); + } + + return array_pop($module); + } } |