Requests_Proxy_HTTP::__construct( array|null $args = null )

Constructor


Parameters

$args array|null Optional
Array of user and password. Must have exactly two elements

Default: null


Top ↑

Source

File: wp-includes/Requests/Proxy/HTTP.php. View all references

public function __construct($args = null) {
	if (is_string($args)) {
		$this->proxy = $args;
	}
	elseif (is_array($args)) {
		if (count($args) === 1) {
			list($this->proxy) = $args;
		}
		elseif (count($args) === 3) {
			list($this->proxy, $this->user, $this->pass) = $args;
			$this->use_authentication                    = true;
		}
		else {
			throw new Requests_Exception('Invalid number of arguments', 'proxyhttpbadargs');
		}
	}
}


Top ↑

Changelog

Changelog
Version Description
1.6 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.