mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 03:54:10 +01:00
Merge branch 'develop' of github.com:phpbb/phpbb3 into ticket/11103
# By Nathaniel Guse # Via David King (2) and Nathaniel Guse (1) * 'develop' of github.com:phpbb/phpbb3: [ticket/11363] Fix a couple bugs and throw errors if the file not found [ticket/11372] Migrator should only check if effectively installed if not [ticket/11363] Load module info files for extensions too
This commit is contained in:
commit
11ca2c15d6
@ -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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,20 +316,20 @@ class phpbb_db_migrator
|
||||
'class' => $migration,
|
||||
);
|
||||
|
||||
if ($migration->effectively_installed())
|
||||
if (!isset($this->migration_state[$name]))
|
||||
{
|
||||
$state = array(
|
||||
'migration_depends_on' => $migration->depends_on(),
|
||||
'migration_schema_done' => true,
|
||||
'migration_data_done' => true,
|
||||
'migration_data_state' => '',
|
||||
'migration_start_time' => 0,
|
||||
'migration_end_time' => 0,
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($this->migration_state[$name]))
|
||||
if ($migration->effectively_installed())
|
||||
{
|
||||
$state = array(
|
||||
'migration_depends_on' => $migration->depends_on(),
|
||||
'migration_schema_done' => true,
|
||||
'migration_data_done' => true,
|
||||
'migration_data_state' => '',
|
||||
'migration_start_time' => 0,
|
||||
'migration_end_time' => 0,
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$state['migration_start_time'] = time();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user