forked from GNUsocial/gnu-social
Start and EndActionExecute added/fixed/documented
This commit is contained in:
parent
1cc96cd334
commit
f25e5e3860
@ -2,6 +2,13 @@ InitializePlugin: a chance to initialize a plugin in a complete environment
|
||||
|
||||
CleanupPlugin: a chance to cleanup a plugin at the end of a program
|
||||
|
||||
StartActionExecute: Right before the "prepare" call of the current Action
|
||||
- $action: the current Action object
|
||||
- &$args: array of arguments, referenced so you can modify the array
|
||||
|
||||
EndActionExecute: Right after the "handle" call of the current Action
|
||||
- $action: the current Action object
|
||||
|
||||
StartPrimaryNav: Showing the primary nav menu
|
||||
- $action: the current action
|
||||
|
||||
|
@ -118,16 +118,18 @@ class Action extends HTMLOutputter // lawsuit
|
||||
common_config_set('db', 'database', $mirror);
|
||||
}
|
||||
|
||||
$status = $this->prepare($args);
|
||||
if ($status) {
|
||||
if (Event::handle('StartActionExecute', array($this, &$args))) {
|
||||
$prepared = $this->prepare($args);
|
||||
if ($prepared) {
|
||||
$this->handle($args);
|
||||
} else {
|
||||
common_debug('Prepare failed for Action.');
|
||||
}
|
||||
}
|
||||
|
||||
$this->flush();
|
||||
|
||||
Event::handle('EndActionExecute', array($status, $this));
|
||||
Event::handle('EndActionExecute', array($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ class CronishPlugin extends Plugin {
|
||||
* When the page has finished rendering, let's do some cron jobs
|
||||
* if we have the time.
|
||||
*/
|
||||
public function onEndActionExecute($status, Action $action)
|
||||
public function onEndActionExecute(Action $action)
|
||||
{
|
||||
$cron = new Cronish();
|
||||
$cron->callTimedEvents();
|
||||
|
@ -14,7 +14,7 @@ class OpportunisticQMPlugin extends Plugin {
|
||||
* When the page has finished rendering, let's do some cron jobs
|
||||
* if we have the time.
|
||||
*/
|
||||
public function onEndActionExecute($status, Action $action)
|
||||
public function onEndActionExecute(Action $action)
|
||||
{
|
||||
if ($action instanceof RunqueueAction) {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user