PHP 8.1.33
Preview: Port.php Size: 1.47 KB
/home/jambtst2015/public_html/www.securiskbrokers.com/wp-includes/Requests/src/Port.php

<?php
/**
 * Port utilities for Requests
 *
 * @package Requests\Utilities
 * @since   2.0.0
 */

namespace WpOrg\Requests;

use WpOrg\Requests\Exception;
use WpOrg\Requests\Exception\InvalidArgument;

/**
 * Find the correct port depending on the Request type.
 *
 * @package Requests\Utilities
 * @since   2.0.0
 */
final class Port {

	/**
	 * Port to use with Acap requests.
	 *
	 * @var int
	 */
	const ACAP = 674;

	/**
	 * Port to use with Dictionary requests.
	 *
	 * @var int
	 */
	const DICT = 2628;

	/**
	 * Port to use with HTTP requests.
	 *
	 * @var int
	 */
	const HTTP = 80;

	/**
	 * Port to use with HTTP over SSL requests.
	 *
	 * @var int
	 */
	const HTTPS = 443;

	/**
	 * Retrieve the port number to use.
	 *
	 * @param string $type Request type.
	 *                     The following requests types are supported:
	 *                     'acap', 'dict', 'http' and 'https'.
	 *
	 * @return int
	 *
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When a non-string input has been passed.
	 * @throws \WpOrg\Requests\Exception                 When a non-supported port is requested ('portnotsupported').
	 */
	public static function get($type) {
		if (!is_string($type)) {
			throw InvalidArgument::create(1, '$type', 'string', gettype($type));
		}

		$type = strtoupper($type);
		if (!defined("self::{$type}")) {
			$message = sprintf('Invalid port type (%s) passed', $type);
			throw new Exception($message, 'portnotsupported');
		}

		return constant("self::{$type}");
	}
}

Directory Contents

Dirs: 7 × Files: 17

Name Size Perms Modified Actions
Auth DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Cookie DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Exception DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Proxy DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Response DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Transport DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
Utility DIR
- drwxr-xr-x 2024-12-09 13:54:37
Edit Download
860 B lrw-r--r-- 2022-12-16 02:32:18
Edit Download
9.12 KB lrw-r--r-- 2023-04-05 17:12:26
Edit Download
652 B lrw-r--r-- 2023-04-05 17:12:26
Edit Download
15.03 KB lrw-r--r-- 2024-03-25 16:23:08
Edit Download
1.09 KB lrw-r--r-- 2022-12-16 02:32:18
Edit Download
709 B lrw-r--r-- 2022-12-16 02:32:18
Edit Download
2.96 KB lrw-r--r-- 2023-10-12 16:34:34
Edit Download
12.14 KB lrw-r--r-- 2023-04-05 17:12:26
Edit Download
5.51 KB lrw-r--r-- 2022-12-16 02:32:18
Edit Download
28.93 KB lrw-r--r-- 2023-10-12 16:34:34
Edit Download
1.47 KB lrw-r--r-- 2022-12-16 02:32:18
Edit Download
867 B lrw-r--r-- 2022-12-16 02:32:18
Edit Download
33.20 KB lrw-r--r-- 2024-03-25 16:23:08
Edit Download
4.18 KB lrw-r--r-- 2023-04-05 17:12:26
Edit Download
8.89 KB lrw-r--r-- 2023-10-12 16:34:34
Edit Download
5.30 KB lrw-r--r-- 2022-12-16 02:32:18
Edit Download
1.51 KB lrw-r--r-- 2022-12-16 02:32:18
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).