You are here

function rules_event_invocation_enabled in Rules 7.2

Helper to enable or disable the invocation of rules events.

Rules invocation is disabled by default, such that Rules does not operate when Drupal is not fully bootstrapped. It gets enabled in rules_init() and rules_enable().

Parameters

bool|null $enable: NULL to leave the setting as is and TRUE / FALSE to change the behaviour.

Return value

bool Whether the rules invocation is enabled or disabled.

6 calls to rules_event_invocation_enabled()
rules_enable in ./rules.install
Implements hook_enable().
rules_init in ./rules.module
Implements hook_init().
rules_invoke_event in ./rules.module
Invokes configured rules for the given event.
rules_invoke_event_by_args in ./rules.module
Invokes configured rules for the given event.
rules_log in ./rules.module
Log a message to the rules logger.

... See full list

File

./rules.module, line 1767
Rules engine module.

Code

function rules_event_invocation_enabled($enable = NULL) {
  static $invocation_enabled = FALSE;
  if (isset($enable)) {
    $invocation_enabled = (bool) $enable;
  }

  // Disable invocation if configured or if site runs in maintenance mode.
  return $invocation_enabled && !defined('MAINTENANCE_MODE');
}