SFAPIclient/Requests.php
protected static function get_transport() {
		// Caching code, don't bother testing coverage
		// @codeCoverageIgnoreStart
		if (!is_null(self::$transport)) {
			return new self::$transport();
		}
		// @codeCoverageIgnoreEnd

		if (empty(self::$transports)) {
			self::$transports = array(
				'Requests_Transport_cURL',
				'Requests_Transport_fsockopen',
			);
		}

		// Find us a working transport
		foreach (self::$transports as $class) {
			if (!class_exists($class))
				continue;

			$result = call_user_func(array($class, 'test'));
			if ($result) {
				self::$transport = $class;
				break;
			}
		}
		if (self::$transport === null) {
			throw new Requests_Exception('No working transports found', 'notransport', self::$transports);
		}

		return new self::$transport();
	}
protected static function get_transport() {
		// Caching code, don't bother testing coverage
		// @codeCoverageIgnoreStart
		if (!is_null(self::$transport)) {
			return new self::$transport();
		}
		// @codeCoverageIgnoreEnd

		if (empty(self::$transports)) {
			self::$transports = array(
				'Requests_Transport_cURL',
				'Requests_Transport_fsockopen',
			);
		}

		// Find us a working transport
		foreach (self::$transports as $class) {
			if (!class_exists($class))
				continue;

			$result = call_user_func(array($class, 'test'));
			if ($result) {
				self::$transport = $class;
				break;
			}
		}
		if (self::$transport === null) {
			throw new Requests_Exception('No working transports found', 'notransport', self::$transports);
		}

		return new self::$transport();
	}
protected static function get_transport ( ) { // Caching code, don't bother testing coverage // @codeCoverageIgnoreStart if ( ! is_null ( self :: $ transport ) ) { return new self :: $ transport ( ) ; } // @codeCoverageIgnoreEnd if ( empty ( self :: $ transports ) ) { self :: $ transports = array ( 'Requests_Transport_cURL' , 'Requests_Transport_fsockopen' , ) ; } // Find us a working transport foreach ( self :: $ transports as $ class ) { if ( ! class_exists ( $ class ) ) continue ; $ result = call_user_func ( array ( $ class , 'test' ) ) ; if ( $ result ) { self :: $ transport = $ class ; break ; } } if ( self :: $ transport === null ) { throw new Requests_Exception ( 'No working transports found' , 'notransport' , self :: $ transports ) ; } return new self :: $ transport ( ) ; }
Get a working transport

@throws Requests_Exception If no valid transport is found (`notransport`)
@return Requests_Transport
Get a working transport