Overview

Namespaces

  • None
  • PHP

Classes

  • RESTian
  • RESTian_Application_Json_Parser
  • RESTian_Application_Serialized_Php_Parser
  • RESTian_Application_Xml_Parser
  • RESTian_Auth_Provider_Base
  • RESTian_Base
  • RESTian_Basic_Http_Auth_Provider
  • RESTian_Client
  • RESTian_Http_Agent_Base
  • RESTian_Not_Applicable_Provider
  • RESTian_Parser_Base
  • RESTian_Php_Curl_Http_Agent
  • RESTian_Request
  • RESTian_Response
  • RESTian_Service
  • RESTian_Settings
  • RESTian_Text_Csv_Parser
  • RESTian_Text_Html_Parser
  • RESTian_Text_Plain_Parser
  • RESTian_Var
  • RESTian_WordPress_Http_Agent
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: 
 3: /**
 4:  * A RESTian_Http_Agent represents the internal type of agent that calls HTTP:
 5:  *
 6:  *   'wordpress' for WordPress wp_remote_get()
 7:  *   'php_curl' for PHP's CURL
 8:  *
 9:  * Having more than one agent allows RESTian to be used outside WordPress.
10:  *
11:  */
12: abstract class RESTian_Http_Agent_Base {
13:   var $agent_type;
14:   var $error_num = false;
15:   var $error_msg = false;
16: 
17:   /**
18:    * @param $agent_type
19:    */
20:   function __construct( $agent_type ) {
21:     $this->agent_type = $agent_type;
22:   }
23: 
24:   /**
25:    * Provides a generic HTTP GET method that can call WordPress' wp_remove_get() if available, or CURL if not.
26:    *
27:    * @param RESTian_Request $request
28:    * @param RESTian_Response $response
29:    * @return RESTian_Response
30:    * @throws Exception
31:    */
32:   function make_request( $request, $response ) {
33:     if (1) // Only here so PhpStorm won't flag as an error
34:       throw new Exception( 'Class ' . get_class($this) . ' [subclass of ' . __CLASS__ . '] must define $this->make_request().' );
35:     return $response;
36:   }
37: 
38: }
39: 
40: 
API documentation generated by ApiGen 2.8.0