1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[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
This commit is contained in:
Nils Adermann
2011-08-29 17:17:40 -04:00
parent 897063d3e2
commit c7a986eccd
13 changed files with 151 additions and 22 deletions

View File

@@ -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);
}