CoreFiles by mySites.guru
cURL.php56 lines, 919 bytes, from wordpress-5.8.19.zip
Raw History Compare with 5.8.18
md5
659e971b46c8391beaf8948c51a62005
sha1
e9e9db4ee124b22b4db8bfe966194c6166c376c2
sha256
f1a512bd8a2f98415610e91f7aa2a53bd37839f5100941b1fcef277b4d4a92ec
<?php

class Requests_Exception_Transport_cURL extends Requests_Exception_Transport {

	const EASY  = 'cURLEasy';
	const MULTI = 'cURLMulti';
	const SHARE = 'cURLShare';

	/**
	 * cURL error code
	 *
	 * @var integer
	 */
	protected $code = -1;

	/**
	 * Which type of cURL error
	 *
	 * EASY|MULTI|SHARE
	 *
	 * @var string
	 */
	protected $type = 'Unknown';

	/**
	 * Clear text error message
	 *
	 * @var string
	 */
	protected $reason = 'Unknown';

	public function __construct($message, $type, $data = null, $code = 0) {
		if ($type !== null) {
			$this->type = $type;
		}

		if ($code !== null) {
			$this->code = $code;
		}

		if ($message !== null) {
			$this->reason = $message;
		}

		$message = sprintf('%d %s', $this->code, $this->reason);
		parent::__construct($message, $this->type, $data, $this->code);
	}

	/**
	 * Get the error message
	 */
	public function getReason() {
		return $this->reason;
	}

}

The same content is in 116 releases, WordPress 5.8-beta1 to 6.1.16. See them all, or every version of this file.