1 | <?php |
||
19 | class Requests_Proxy_HTTP implements Requests_Proxy { |
||
20 | /** |
||
21 | * Proxy host and port |
||
22 | * |
||
23 | * Notation: "host:port" (eg 127.0.0.1:8080 or someproxy.com:3128) |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | public $proxy; |
||
28 | |||
29 | /** |
||
30 | * Username |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | public $user; |
||
35 | |||
36 | /** |
||
37 | * Password |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | public $pass; |
||
42 | |||
43 | /** |
||
44 | * Do we need to authenticate? (ie username & password have been provided) |
||
45 | * |
||
46 | * @var boolean |
||
47 | */ |
||
48 | public $use_authentication; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * @since 1.6 |
||
54 | * @throws Requests_Exception On incorrect number of arguments (`authbasicbadargs`) |
||
55 | * @param array|null $args Array of user and password. Must have exactly two elements |
||
56 | */ |
||
57 | public function __construct($args = null) { |
||
74 | |||
75 | /** |
||
76 | * Register the necessary callbacks |
||
77 | * |
||
78 | * @since 1.6 |
||
79 | * @see curl_before_send |
||
80 | * @see fsockopen_remote_socket |
||
81 | * @see fsockopen_remote_host_path |
||
82 | * @see fsockopen_header |
||
83 | * @param Requests_Hooks $hooks Hook system |
||
84 | */ |
||
85 | public function register(Requests_Hooks &$hooks) { |
||
94 | |||
95 | /** |
||
96 | * Set cURL parameters before the data is sent |
||
97 | * |
||
98 | * @since 1.6 |
||
99 | * @param resource $handle cURL resource |
||
100 | */ |
||
101 | public function curl_before_send(&$handle) { |
||
110 | |||
111 | /** |
||
112 | * Alter remote socket information before opening socket connection |
||
113 | * |
||
114 | * @since 1.6 |
||
115 | * @param string $remote_socket Socket connection string |
||
116 | */ |
||
117 | public function fsockopen_remote_socket(&$remote_socket) { |
||
120 | |||
121 | /** |
||
122 | * Alter remote path before getting stream data |
||
123 | * |
||
124 | * @since 1.6 |
||
125 | * @param string $path Path to send in HTTP request string ("GET ...") |
||
126 | * @param string $url Full URL we're requesting |
||
127 | */ |
||
128 | public function fsockopen_remote_host_path(&$path, $url) { |
||
131 | |||
132 | /** |
||
133 | * Add extra headers to the request before sending |
||
134 | * |
||
135 | * @since 1.6 |
||
136 | * @param string $out HTTP header string |
||
137 | */ |
||
138 | public function fsockopen_header(&$out) { |
||
141 | |||
142 | /** |
||
143 | * Get the authentication string (user:pass) |
||
144 | * |
||
145 | * @since 1.6 |
||
146 | * @return string |
||
147 | */ |
||
148 | public function get_auth_string() { |
||
151 | } |
This check marks property names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString
.