Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.217.137
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/wp-content/plugins/rocket-lazy-load/src/EventManagement/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/rocket-lazy-load/src/EventManagement/EventManager.php
<?php
/**
 * Event Manager to interact with the WP plugin API
 *
 * @package RocketLazyload
 */

namespace RocketLazyLoadPlugin\EventManagement;

defined('ABSPATH') || die('Cheatin\' uh?');

/**
 * The event manager manages events using the WordPress plugin API.
 *
 * @since 3.1
 * @author Carl Alexander <contact@carlalexander.ca>
 */
class EventManager
{
    /**
     * Adds a callback to a specific hook of the WordPress plugin API.
     *
     * @uses add_filter()
     *
     * @param string   $hook_name     Name of the hook.
     * @param callable $callback      Callback function.
     * @param int      $priority      Priority.
     * @param int      $accepted_args Number of arguments.
     */
    public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1)
    {
        add_filter($hook_name, $callback, $priority, $accepted_args);
    }

    /**
     * Add an event subscriber.
     *
     * The event manager registers all the hooks that the given subscriber
     * wants to register with the WordPress Plugin API.
     *
     * @param SubscriberInterface $subscriber SubscriberInterface implementation.
     */
    public function addSubscriber(SubscriberInterface $subscriber)
    {
        if ($subscriber instanceof EventManagerAwareSubscriberInterface) {
            $subscriber->setEventManager($this);
        }

        foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
            $this->addSubscriberCallback($subscriber, $hook_name, $parameters);
        }
    }

    /**
     * Checks the WordPress plugin API to see if the given hook has
     * the given callback. The priority of the callback will be returned
     * or false. If no callback is given will return true or false if
     * there's any callbacks registered to the hook.
     *
     * @uses has_filter()
     *
     * @param string $hook_name Hook name.
     * @param mixed  $callback  Callback.
     *
     * @return bool|int
     */
    public function hasCallback($hook_name, $callback = false)
    {
        return has_filter($hook_name, $callback);
    }

    /**
     * Removes the given callback from the given hook. The WordPress plugin API only
     * removes the hook if the callback and priority match a registered hook.
     *
     * @uses remove_filter()
     *
     * @param string   $hook_name Hook name.
     * @param callable $callback  Callback.
     * @param int      $priority  Priority.
     *
     * @return bool
     */
    public function removeCallback($hook_name, $callback, $priority = 10)
    {
        return remove_filter($hook_name, $callback, $priority);
    }

    /**
     * Remove an event subscriber.
     *
     * The event manager removes all the hooks that the given subscriber
     * wants to register with the WordPress Plugin API.
     *
     * @param SubscriberInterface $subscriber SubscriberInterface implementation.
     */
    public function removeSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
            $this->removeSubscriberCallback($subscriber, $hook_name, $parameters);
        }
    }

    /**
     * Adds the given subscriber's callback to a specific hook
     * of the WordPress plugin API.
     *
     * @param SubscriberInterface $subscriber SubscriberInterface implementation.
     * @param string              $hook_name  Hook name.
     * @param mixed               $parameters Parameters, can be a string, an array or a multidimensional array.
     */
    private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
    {
        if (is_string($parameters)) {
            $this->addCallback($hook_name, [ $subscriber, $parameters ]);
        } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
            foreach ($parameters as $parameter) {
                $this->addSubscriberCallback($subscriber, $hook_name, $parameter);
            }
        } elseif (is_array($parameters) && isset($parameters[0])) {
            $this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1);
        }
    }

    /**
     * Removes the given subscriber's callback to a specific hook
     * of the WordPress plugin API.
     *
     * @param SubscriberInterface $subscriber SubscriberInterface implementation.
     * @param string              $hook_name  Hook name.
     * @param mixed               $parameters Parameters, can be a string, an array or a multidimensional array.
     */
    private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
    {
        if (is_string($parameters)) {
            $this->removeCallback($hook_name, [ $subscriber, $parameters ]);
        } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
            foreach ($parameters as $parameter) {
                $this->removeSubscriberCallback($subscriber, $hook_name, $parameter);
            }
        } elseif (is_array($parameters) && isset($parameters[0])) {
            $this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10);
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit