From 14f1e581faa3b66e7689c55c1e9c0485c0872b1e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 9 Jun 2011 05:13:26 +0200 Subject: [feature/extension-manager] Extension Manager & Finder Extensions RFC: http://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=41499 Ticket: http://tracker.phpbb.com/browse/PHPBB3-10323 PHPBB3-10323 --- phpBB/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 524c05ae70..7ff06e68d7 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -96,7 +96,7 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first -$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); +$class_loader = new phpbb_class_loader($phpbb_root_path . 'includes/', $phpbb_root_path . 'ext/', '.' . $phpEx); $class_loader->register(); // set up caching -- cgit v1.2.1 From fb943d4d6b39cea9825aab78e397eefe26cf7bdf Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 15 Aug 2011 19:34:30 -0400 Subject: [feature/extension-manager] Load the extension manager on all pages PHPBB3-10323 --- phpBB/common.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 7ff06e68d7..cc33b29a09 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -124,6 +124,9 @@ $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); set_config(null, null, null, $config); set_config_count(null, null, null, $config); +// load extensions +$phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); + $template_locator = new phpbb_template_locator(); $template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator); @@ -138,5 +141,5 @@ foreach ($cache->obtain_hooks() as $hook) if (!$config['use_system_cron']) { - $cron = new phpbb_cron_manager($phpbb_root_path . 'includes/cron/task', $phpEx, $cache->get_driver()); + $cron = new phpbb_cron_manager($phpbb_extension_manager, $cache->get_driver()); } -- cgit v1.2.1 From 96209e022477d97b581b79cabace4caddd19501b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 15 Aug 2011 21:38:47 -0400 Subject: [feature/extension-manager] The class loader no longer knows about extensions Instead the class loader is instantiated twice. Once with the phpbb_ prefix and once with the phpbb_ext_ prefix. PHPBB3-10323 --- phpBB/common.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index cc33b29a09..61817972f9 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -96,13 +96,16 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first -$class_loader = new phpbb_class_loader($phpbb_root_path . 'includes/', $phpbb_root_path . 'ext/', '.' . $phpEx); -$class_loader->register(); +$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); +$phpbb_class_loader_ext->register(); +$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); +$phpbb_class_loader->register(); // set up caching $cache_factory = new phpbb_cache_factory($acm_type); $cache = $cache_factory->get_service(); -$class_loader->set_cache($cache->get_driver()); +$phpbb_class_loader_ext->set_cache($cache->get_driver()); +$phpbb_class_loader->set_cache($cache->get_driver()); // Instantiate some basic classes $request = new phpbb_request(); -- cgit v1.2.1 From 5d5030a48be3d65df85d78e26690085c0889c6e3 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 21 Aug 2011 02:57:01 -0400 Subject: [feature/extension-manager] Remove cron's dependency on the extension manager. Instead a separate cron provider supplies the manager with tasks from the extension finder. PHPBB3-10323 --- phpBB/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 61817972f9..3cc9e57e46 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -144,5 +144,5 @@ foreach ($cache->obtain_hooks() as $hook) if (!$config['use_system_cron']) { - $cron = new phpbb_cron_manager($phpbb_extension_manager, $cache->get_driver()); + $cron = new phpbb_cron_manager(new phpbb_cron_provider($phpbb_extension_manager), $cache->get_driver()); } -- cgit v1.2.1 From ea46feb11542a9cf54ce083ee0ad03f4c5e02a1e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 30 Aug 2011 01:32:11 -0400 Subject: [feature/extension-manager] Add support for templates in extensions. This commit adds a template path provider to separate the process of locating (cached) paths in extensions from the template engine. The locator is supplied with a list of paths from the path provider. Admin templates can now be created in ext//adm/style/ and regular templates go into ext//styles/