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
|
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
|
StartPrimaryNav: Showing the primary nav menu
|
||||||
- $action: the current action
|
- $action: the current action
|
||||||
|
|
||||||
|
@ -118,16 +118,18 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
common_config_set('db', 'database', $mirror);
|
common_config_set('db', 'database', $mirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $this->prepare($args);
|
if (Event::handle('StartActionExecute', array($this, &$args))) {
|
||||||
if ($status) {
|
$prepared = $this->prepare($args);
|
||||||
$this->handle($args);
|
if ($prepared) {
|
||||||
} else {
|
$this->handle($args);
|
||||||
common_debug('Prepare failed for Action.');
|
} else {
|
||||||
|
common_debug('Prepare failed for Action.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->flush();
|
$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
|
* When the page has finished rendering, let's do some cron jobs
|
||||||
* if we have the time.
|
* if we have the time.
|
||||||
*/
|
*/
|
||||||
public function onEndActionExecute($status, Action $action)
|
public function onEndActionExecute(Action $action)
|
||||||
{
|
{
|
||||||
$cron = new Cronish();
|
$cron = new Cronish();
|
||||||
$cron->callTimedEvents();
|
$cron->callTimedEvents();
|
||||||
|
@ -14,7 +14,7 @@ class OpportunisticQMPlugin extends Plugin {
|
|||||||
* When the page has finished rendering, let's do some cron jobs
|
* When the page has finished rendering, let's do some cron jobs
|
||||||
* if we have the time.
|
* if we have the time.
|
||||||
*/
|
*/
|
||||||
public function onEndActionExecute($status, Action $action)
|
public function onEndActionExecute(Action $action)
|
||||||
{
|
{
|
||||||
if ($action instanceof RunqueueAction) {
|
if ($action instanceof RunqueueAction) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user