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
common_config_set('db', 'database', $mirror);
}
- $status = $this->prepare($args);
- if ($status) {
- $this->handle($args);
- } else {
- common_debug('Prepare failed for Action.');
+ 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));
}
/**
* 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();
* 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;