From a6f877c0d84ff102d3812246eae7469e191983e2 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Sat, 2 Mar 2013 14:15:59 -0600 Subject: [PATCH] [ticket/11386] Fix circular reference error & serialize error PHPBB3-11386 --- phpBB/config/migrator.yml | 3 ++- phpBB/includes/db/migrator.php | 13 +++++++++++-- phpBB/includes/extension/finder.php | 1 - 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/phpBB/config/migrator.yml b/phpBB/config/migrator.yml index fc534227f5..42445ef9bf 100644 --- a/phpBB/config/migrator.yml +++ b/phpBB/config/migrator.yml @@ -5,12 +5,13 @@ services: - @config - @dbal.conn - @dbal.tools - - @ext.manager - %tables.migrations% - %core.root_path% - %core.php_ext% - %core.table_prefix% - @migrator.tool_collection + calls: + - [set_extension_manager, [@ext.manager]] migrator.tool_collection: class: phpbb_di_service_collection diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php index 855e640554..de9c06948c 100644 --- a/phpBB/includes/db/migrator.php +++ b/phpBB/includes/db/migrator.php @@ -72,12 +72,11 @@ class phpbb_db_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->db = $db; $this->db_tools = $db_tools; - $this->extension_manager = $extension_manager; $this->migrations_table = $migrations_table; @@ -94,6 +93,16 @@ class phpbb_db_migrator $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. * diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index 15e6db1bbe..f71e32bc8d 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -475,7 +475,6 @@ class phpbb_extension_finder 'ext_name' => $ext_name, 'path' => str_replace(array(DIRECTORY_SEPARATOR, $this->phpbb_root_path), array('/', ''), $file_info->getPath()) . '/', 'filename' => $filename, - 'file_info' => $file_info, ); } }