[ticket/11386] Fix circular reference error & serialize error

PHPBB3-11386
This commit is contained in:
Nathaniel Guse 2013-03-02 14:15:59 -06:00
parent 024c21f30d
commit a6f877c0d8
3 changed files with 13 additions and 4 deletions

View file

@ -5,12 +5,13 @@ services:
- @config - @config
- @dbal.conn - @dbal.conn
- @dbal.tools - @dbal.tools
- @ext.manager
- %tables.migrations% - %tables.migrations%
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
- %core.table_prefix% - %core.table_prefix%
- @migrator.tool_collection - @migrator.tool_collection
calls:
- [set_extension_manager, [@ext.manager]]
migrator.tool_collection: migrator.tool_collection:
class: phpbb_di_service_collection class: phpbb_di_service_collection

View file

@ -72,12 +72,11 @@ class phpbb_db_migrator
/** /**
* Constructor of the database migrator * Constructor of the database migrator
*/ */
public function __construct(phpbb_config $config, phpbb_db_driver $db, phpbb_db_tools $db_tools, phpbb_extension_manager $extension_manager, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools) public function __construct(phpbb_config $config, phpbb_db_driver $db, phpbb_db_tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools)
{ {
$this->config = $config; $this->config = $config;
$this->db = $db; $this->db = $db;
$this->db_tools = $db_tools; $this->db_tools = $db_tools;
$this->extension_manager = $extension_manager;
$this->migrations_table = $migrations_table; $this->migrations_table = $migrations_table;
@ -94,6 +93,16 @@ class phpbb_db_migrator
$this->load_migration_state(); $this->load_migration_state();
} }
/**
* Set Extension Manager (required)
*
* Not in constructor to prevent circular reference error
*/
public function set_extension_manager(phpbb_extension_manager $extension_manager)
{
$this->extension_manager = $extension_manager;
}
/** /**
* Loads all migrations and their application state from the database. * Loads all migrations and their application state from the database.
* *

View file

@ -475,7 +475,6 @@ class phpbb_extension_finder
'ext_name' => $ext_name, 'ext_name' => $ext_name,
'path' => str_replace(array(DIRECTORY_SEPARATOR, $this->phpbb_root_path), array('/', ''), $file_info->getPath()) . '/', 'path' => str_replace(array(DIRECTORY_SEPARATOR, $this->phpbb_root_path), array('/', ''), $file_info->getPath()) . '/',
'filename' => $filename, 'filename' => $filename,
'file_info' => $file_info,
); );
} }
} }