SILENT KILLERPanel

Current Path: > home > codekrsu > > escapematrixonline.com > wp-includes > > Requests > src


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//escapematrixonline.com/wp-includes//Requests/src

NameTypeSizeLast ModifiedActions
Auth Directory - -
Cookie Directory - -
Exception Directory - -
Proxy Directory - -
Response Directory - -
Transport Directory - -
Utility Directory - -
Auth.php File 860 bytes December 16 2022 02:32:18.
Autoload.php File 9335 bytes April 05 2023 17:12:26.
Capability.php File 652 bytes April 05 2023 17:12:26.
Cookie.php File 15389 bytes March 25 2024 16:23:08.
Exception.php File 1114 bytes December 16 2022 02:32:18.
HookManager.php File 709 bytes December 16 2022 02:32:18.
Hooks.php File 3032 bytes October 12 2023 16:34:34.
IdnaEncoder.php File 12435 bytes April 05 2023 17:12:26.
Ipv6.php File 5639 bytes December 16 2022 02:32:18.
Iri.php File 29622 bytes October 12 2023 16:34:34.
Port.php File 1505 bytes December 16 2022 02:32:18.
Proxy.php File 867 bytes December 16 2022 02:32:18.
Requests.php File 34001 bytes March 25 2024 16:23:08.
Response.php File 4281 bytes April 05 2023 17:12:26.
Session.php File 9107 bytes October 12 2023 16:34:34.
Ssl.php File 5425 bytes December 16 2022 02:32:18.
Transport.php File 1544 bytes December 16 2022 02:32:18.

Reading File: /home/codekrsu//escapematrixonline.com/wp-includes//Requests/src/Hooks.php

<?php
/**
 * Handles adding and dispatching events
 *
 * @package Requests\EventDispatcher
 */

namespace WpOrg\Requests;

use WpOrg\Requests\Exception\InvalidArgument;
use WpOrg\Requests\HookManager;
use WpOrg\Requests\Utility\InputValidator;

/**
 * Handles adding and dispatching events
 *
 * @package Requests\EventDispatcher
 */
class Hooks implements HookManager {
	/**
	 * Registered callbacks for each hook
	 *
	 * @var array
	 */
	protected $hooks = [];

	/**
	 * Register a callback for a hook
	 *
	 * @param string $hook Hook name
	 * @param callable $callback Function/method to call on event
	 * @param int $priority Priority number. <0 is executed earlier, >0 is executed later
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string.
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $callback argument is not callable.
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $priority argument is not an integer.
	 */
	public function register($hook, $callback, $priority = 0) {
		if (is_string($hook) === false) {
			throw InvalidArgument::create(1, '$hook', 'string', gettype($hook));
		}

		if (is_callable($callback) === false) {
			throw InvalidArgument::create(2, '$callback', 'callable', gettype($callback));
		}

		if (InputValidator::is_numeric_array_key($priority) === false) {
			throw InvalidArgument::create(3, '$priority', 'integer', gettype($priority));
		}

		if (!isset($this->hooks[$hook])) {
			$this->hooks[$hook] = [
				$priority => [],
			];
		} elseif (!isset($this->hooks[$hook][$priority])) {
			$this->hooks[$hook][$priority] = [];
		}

		$this->hooks[$hook][$priority][] = $callback;
	}

	/**
	 * Dispatch a message
	 *
	 * @param string $hook Hook name
	 * @param array $parameters Parameters to pass to callbacks
	 * @return boolean Successfulness
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string.
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $parameters argument is not an array.
	 */
	public function dispatch($hook, $parameters = []) {
		if (is_string($hook) === false) {
			throw InvalidArgument::create(1, '$hook', 'string', gettype($hook));
		}

		// Check strictly against array, as Array* objects don't work in combination with `call_user_func_array()`.
		if (is_array($parameters) === false) {
			throw InvalidArgument::create(2, '$parameters', 'array', gettype($parameters));
		}

		if (empty($this->hooks[$hook])) {
			return false;
		}

		if (!empty($parameters)) {
			// Strip potential keys from the array to prevent them being interpreted as parameter names in PHP 8.0.
			$parameters = array_values($parameters);
		}

		ksort($this->hooks[$hook]);

		foreach ($this->hooks[$hook] as $priority => $hooked) {
			foreach ($hooked as $callback) {
				$callback(...$parameters);
			}
		}

		return true;
	}

	public function __wakeup() {
		throw new \LogicException( __CLASS__ . ' should never be unserialized' );
	}
}

SILENT KILLER Tool