Set the callback that has the plugin's structure

@param        $pluginStructure \Closure Callback that will be called
@param bool   $audit           Set status audit

@param string $tag

@return void
343416
public static function plugin(\Closure $pluginStructure, $audit = false, $tag = "plugins_loaded")
    {
        $mocaBonita = self::getInstance();
        $mocaBonita->audit = (bool) $audit;

        if ($mocaBonita->audit) {

            MbWPActionHook::addActionCallback('plugins_loaded', function () use ($mocaBonita) {
                try {
                    MbDatabase::enableQueryLog();
                    $mocaBonita->getMbAudit()->setMocaBonita($mocaBonita);
                    $mocaBonita->getMbAudit()->setUser(MbWpUser::getCurrentUser(true));
                } catch (\Exception $e) {
                    $mocaBonita->getMbResponse()->setContent($e);
                }
            });

            MbWPActionHook::addActionCallback('shutdown', function () use ($mocaBonita) {
                try {
                    $mocaBonita->getMbAudit()->run();
                } catch (\Exception $e) {
                    error_log($e->getMessage());
                } finally {
                    MbDatabase::disableQueryLog();
                }
            });

        }

        MbWPActionHook::addActionCallback($tag, function () use ($pluginStructure, $mocaBonita) {
            try {
                call_user_func_array($pluginStructure, [$mocaBonita]);
                $mocaBonita->runPlugin();
            } catch (\Exception $e) {
                $mocaBonita->mbResponse->setContent($e);
            } finally {
                $mocaBonita->runHookCurrentAction();
                $mocaBonita->getMbAudit()->setResponseStatusCode($mocaBonita->mbResponse->status());
                $mocaBonita->getMbAudit()->setResponseHeader($mocaBonita->mbResponse->headers->all());
                $mocaBonita->mbResponse->sendHeaders();
            }
        });
    }
1209344
public function executeOnce(\Closure $task)
    {
        $isBlocked = $this->checkedLock();
        $error = null;
        try {
            if (! $isBlocked) {
                call_user_func($task);

            }
        } catch (\Exception $e) {
            $error = $e;

        }
        $this->unlock();
        if (! is_null($error)) {
            throw $error;

        }
    }
762676
function View_setTag(name, parse, compile, ends, blockLevel) {
            this.swig.setTag(name, parse, compile, ends, blockLevel);
        }
838313
public static function e($message, $tags = array())
    {
        self::singleton()->log(self::ERROR_LEVEL, $message, self::addTrace($tags));
    }
1117912
public function set($key, $tag)
    {
        if ($tag instanceof Tag) {
            throw InvalidTagException::build([], ['invalidTag' => $tag]);
        }

        parent::set($key, $tag);
    }
911806
public function parseShortcode(string $content, array $tags, Closure $callback = null)
    {
        if (strpos($content, '[') === false && empty($tags)) {
            return is_null($callback) ? [] : $content;
        }

        $regex = $this->getRegex($tags);

        preg_match_all("/$regex/", $content, $matches, PREG_SET_ORDER);

        if (is_null($callback)) {
            return iterator_to_array($this->generateResults($matches));
        }

        return preg_replace_callback("/$regex/", $this->generateCallback($callback), $content);
    }
388055
public function checkTemplate($template, Tag $tag = null)
	{
		if ($this->disabled)
		{
			return;
		}

		if (!isset($tag))
		{
			$tag = new Tag;
		}

		// Load the template into a DOMDocument
		$dom = TemplateLoader::load($template);

		foreach ($this->collection as $check)
		{
			$check->check($dom->documentElement, $tag);
		}
	}
336456
function Plugin() {

    this.name = "Audit-Plugin";
    this.resources = new Map();
    this.duplicateContents = new Map();
    this.inLinks = new Map();
    this.outLinks = new Map();
    this.externalLinks = new Map();
    this.unparsedLinks =  new Set();
    this.images = new Map();
    this.errors = new Set();
    this.redirects = new Map();


}
376656
public function getPluginFromDefaultHandler($tag, $plugin_type)
    {
        $callback = null;
        $script = null;
        $cacheable = true;
        $result = call_user_func_array(
            $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)
        );
        if ($result) {
            $this->tag_nocache = $this->tag_nocache || !$cacheable;
            if ($script !== null) {
                if (is_file($script)) {
                    if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['file'] = $script;
                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['function'] = $callback;
                    } else {
                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;
                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;
                    }
                    include_once $script;
                } else {
                    $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
                }
            }
            if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) {
                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");
            }
            if (is_callable($callback)) {
                $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array());

                return true;
            } else {
                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");
            }
        }

        return false;
    }
326177
public function check(DOMElement $template, Tag $tag)
	{
		foreach ($this->getNodes($template) as $node)
		{
			// Test this node's safety
			$this->checkNode($node, $tag);
		}
	}
37904
protected void updatePluginConfiguration(PluginConfiguration value, String xmlTag, Counter counter,
            Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         updatePluginManagement(value.getPluginManagement(), "pluginManagement", innerCount, root);
         iteratePlugin(innerCount, root, value.getPlugins(), "plugins", "plugin");
      }
   }
101150
def plugin_info_by_tag(tag, opts={})
      matches = Fluent::Engine.root_agent.event_router.instance_variable_get(:@match_rules)
      matches.each { |rule|
        if rule.match?(tag)
          if rule.collector.is_a?(Fluent::Plugin::Output) || rule.collector.is_a?(Fluent::Output)
            return get_monitor_info(rule.collector, opts)
          end
        end
      }
      nil
    end
875189
public function listen(Closure $callback, array $query = []): self
    {
        if (0 === count($query)) {
            $query = [
                'timestamp' => ['$gte' => new UTCDateTime()],
            ];
        }

        $cursor = $this->events->getCursor($query);

        while (true) {
            if (null === $cursor->current()) {
                if ($cursor->getInnerIterator()->isDead()) {
                    $this->logger->error('events queue cursor is dead, is it a capped collection?', [
                        'category' => get_class($this),
                    ]);

                    $this->events->create();

                    return $this->listen($callback, $query);
                }

                $this->events->next($cursor, function () use ($callback, $query) {
                    return $this->listen($callback, $query);
                });

                continue;
            }

            $result = $cursor->current();
            $this->events->next($cursor, function () use ($callback, $query) {
                $this->listen($callback, $query);
            });

            $process = new Process($result, $this, $this->events);
            if (true === $callback($process)) {
                return $this;
            }
        }
    }
1369893
function set($k, $v, $tags = []) {
		if ($v instanceof ICached) {
			$tags += $v->tags();
		}
		$this->_data[$k] = $v;
		foreach ($tags as $tag) { /** @var string $tag */
			if (!isset($this->_tags[$tag])) {
				$this->_tags[$tag] = [$k];
			}
			else if (!in_array($k, $this->_tags[$tag])) {
				$this->_tags[$tag][] = $k;
			}
		}
		return $v;
	}
569440
public static void setTag(String tag) {
        d("Changing log tag to %s", tag);
        TAG = tag;

        // Reinitialize the DEBUG "constant"
        DEBUG = Log.isLoggable(TAG, Log.VERBOSE);
    }
930434
public function on($event, \Closure $callback): void
    {
        // check if event is a single string and parse it to array single item
        if (!Any::isArray($event)) {
            $event = [$event];
        }
        
        foreach ($event as $item) {
            $this->events[$item][] = $callback;
        }
    }
520909
function setScope (scope) {
    // throw error if attempting operation on complete audit record
    assert.ok(!this.complete, 'cannot setScope on complete audit record')
    // set scope value
    this.scope = scope
    // allow request is complete
    this.complete = true
    // debug
    debug(this)
    // return set value
    return this.scope
}