Ejemplo n.º 1
0
 /**
  * Registers a global hook callback. Global hooks are registered with the instance fixtures upon creation.
  *
  * @param $hook_name
  *   The name of the hook.
  * @param $fixture_name
  *   The fixture for which to register the hook.
  * @param $callback
  *   The callback function
  */
 public static function registerGlobalHookCallback($hook_name, $fixture_name, $callback)
 {
     if (isset(self::$glabal_hook_callbacks) === FALSE) {
         self::$glabal_hook_callbacks = array(self::PreSetBuildHook => array());
     }
     if (in_array($hook_name, array(self::PreSetBuildHook)) === FALSE) {
         throw new fValidationException('Invalid hook name, %s', $hook_name);
     }
     if (isset(self::$glabal_hook_callbacks[$hook_name][$fixture_name]) === FALSE) {
         self::$glabal_hook_callbacks[$hook_name][$fixture_name] = array();
     }
     self::$glabal_hook_callbacks[$hook_name][$fixture_name][] = $callback;
 }