mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/11386
Conflicts: phpBB/includes/extension/finder.php
This commit is contained in:
commit
59638a6a7d
3 changed files with 35 additions and 29 deletions
|
@ -535,8 +535,14 @@ class acp_modules
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get available module information from module files
|
* Get available module information from module files
|
||||||
|
*
|
||||||
|
* @param string $module
|
||||||
|
* @param bool|string $module_class
|
||||||
|
* @param bool $use_all_available Use all available instead of just all
|
||||||
|
* enabled extensions
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_module_infos($module = '', $module_class = false)
|
function get_module_infos($module = '', $module_class = false, $use_all_available = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
@ -556,7 +562,7 @@ class acp_modules
|
||||||
->extension_directory("/$module_class")
|
->extension_directory("/$module_class")
|
||||||
->core_path("includes/$module_class/info/")
|
->core_path("includes/$module_class/info/")
|
||||||
->core_prefix($module_class . '_')
|
->core_prefix($module_class . '_')
|
||||||
->get_classes();
|
->get_classes(true, $use_all_available);
|
||||||
|
|
||||||
foreach ($modules as $module)
|
foreach ($modules as $module)
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,19 +183,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interfac
|
||||||
$basename = str_replace(array('/', '\\'), '', $basename);
|
$basename = str_replace(array('/', '\\'), '', $basename);
|
||||||
$class = str_replace(array('/', '\\'), '', $class);
|
$class = str_replace(array('/', '\\'), '', $class);
|
||||||
|
|
||||||
if (!class_exists('acp_modules'))
|
$module = $this->get_module_info($class, $basename);
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach ($module['modes'] as $mode => $module_info)
|
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']);
|
$basename = str_replace(array('/', '\\'), '', $module['module_basename']);
|
||||||
$class = str_replace(array('/', '\\'), '', $class);
|
$class = str_replace(array('/', '\\'), '', $class);
|
||||||
|
|
||||||
if (!class_exists('acp_modules'))
|
$module_info = $this->get_module_info($class, $basename);
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($module_info['modes'] as $mode => $info)
|
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);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple
|
||||||
if ($path && !phpbb_is_absolute($path))
|
if ($path && !phpbb_is_absolute($path))
|
||||||
{
|
{
|
||||||
$result = $finder->directory('/' . $this->ext_dir_prefix . $path)
|
$result = $finder->directory('/' . $this->ext_dir_prefix . $path)
|
||||||
->get_directories(true, true);
|
->get_directories(true, false, true);
|
||||||
foreach ($result as $ext => $ext_path)
|
foreach ($result as $ext => $ext_path)
|
||||||
{
|
{
|
||||||
$directories[$ext][] = $ext_path;
|
$directories[$ext][] = $ext_path;
|
||||||
|
|
Loading…
Add table
Reference in a new issue