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/includes/extension/interface.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 phpBB/includes/extension/interface.php (limited to 'phpBB/includes/extension/interface.php') diff --git a/phpBB/includes/extension/interface.php b/phpBB/includes/extension/interface.php new file mode 100644 index 0000000000..40a5a066a3 --- /dev/null +++ b/phpBB/includes/extension/interface.php @@ -0,0 +1,27 @@ + Date: Mon, 29 Aug 2011 17:17:40 -0400 Subject: [feature/extension-manager] Use an incremental process for enable and purge The enable or purge operation of an extension could take a long time if an expensive operation needs to be executed on a large set of data. To allow this to succeed from a web interface with max_execution_time set in the webserver's php configuration, subsequent requests must continue the operation started earlier. So individual enable and purge implementations must be able to spread their work across multiple steps. PHPBB3-10323 --- phpBB/includes/extension/interface.php | 39 ++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/extension/interface.php') diff --git a/phpBB/includes/extension/interface.php b/phpBB/includes/extension/interface.php index 40a5a066a3..7d0ecd72c7 100644 --- a/phpBB/includes/extension/interface.php +++ b/phpBB/includes/extension/interface.php @@ -16,12 +16,47 @@ if (!defined('IN_PHPBB')) } /** +* The interface extension meta classes have to implement to run custom code +* on enable/disable/purge. * * @package extension */ interface phpbb_extension_interface { - public function enable(); + /** + * enable_step is executed on enabling an extension until it returns false. + * + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. + * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call + * @return mixed Returns false after last step, otherwise + * temporary state which is passed as an + * argument to the next step + */ + public function enable_step($old_state); + + /** + * Disables the extension. + * + * Must be a quick operation, that finishes within max_execution_time. + * + * @return null + */ public function disable(); - public function purge(); + + /** + * purge_step is executed on purging an extension until it returns false. + * + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. + * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call + * @return mixed Returns false after last step, otherwise + * temporary state which is passed as an + * argument to the next step + */ + public function purge_step($old_state); } -- cgit v1.2.1 From 5068c0588733f80a8433aea1cd6f763819caa9f7 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 18 Nov 2011 18:15:39 +0100 Subject: [feature/extension-manager] Split disabling extensions up into steps as well PHPBB3-10323 --- phpBB/includes/extension/interface.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/extension/interface.php') diff --git a/phpBB/includes/extension/interface.php b/phpBB/includes/extension/interface.php index 7d0ecd72c7..b37cd24d77 100644 --- a/phpBB/includes/extension/interface.php +++ b/phpBB/includes/extension/interface.php @@ -40,11 +40,14 @@ interface phpbb_extension_interface /** * Disables the extension. * - * Must be a quick operation, that finishes within max_execution_time. + * Calls to this function can be made in subsequent requests, when the + * function is invoked through a webserver with a too low max_execution_time. * + * @param mixed $old_state The return value of the previous call + * of this method, or false on the first call * @return null */ - public function disable(); + public function disable_step($old_state); /** * purge_step is executed on purging an extension until it returns false. -- cgit v1.2.1