Lines Matching refs:this

38     return $this->url;
42 $this->redirects = 0;
44 if ($this->fetch($data_id)) {
45 if ($this->code != HTTP_OK) {
47 $_server_response = $this->headers;
48 $_http_error = $this->code;
53 $this->error_message .= ob_get_contents();
56 error_log("Cannot open $data_id, HTTP result code is: ".$this->code);
61 return new FetchedDataURL($this->content,
62 explode("\r\n",$this->headers),
63 $this->url);
64 } elseif ($this->redirects > MAX_REDIRECTS) {
65 $_server_response = $this->headers;
70 $this->error_message .= ob_get_contents();
78 $_server_response = $this->headers;
83 $this->error_message .= ob_get_contents();
94 return $this->error_message;
100 $this->_connections = array();
102 $this->error_message = "";
104 $this->redirects = 0;
105 $this->port = 80;
110 $this->user_agent = DEFAULT_USER_AGENT;
127 if ($this->protocol == "https") {
128 return $this->_connect_ssl();
131 $fp = @fsockopen($this->host,$this->port,$errno,$errstr,HTML2PS_CONNECTION_TIMEOUT);
135 $this->host,
136 $this->port,
140 $this->error_message = $message;
157 $this->host,
158 $this->port);
160 $this->error_message .= $message;
164 $fp = @fsockopen("ssl://$this->host", $this->port, $errno, $errstr, 5);
168 $this->host,
169 $this->port,
173 $this->error_message = $message;
201 return $this->protocol."://".$this->host.$location;
204 return $this->protocol."://".$this->host.$this->path.$location;
218 $this->url = $url;
220 $parts = @parse_url($this->url);
228 error_log(sprintf("The URL '%s' could not be parsed", $this->url));
230 $this->content = '';
231 $this->code = HTTP_OK;
238 $this->protocol = 'http';
239 $this->host = 'localhost';
240 $this->user = "";
241 $this->pass = "";
242 $this->port = 80;
243 $this->path = "/";
244 $this->query = "";
246 if (isset($parts['scheme'])) { $this->protocol = $parts['scheme']; };
247 if (isset($parts['host'])) { $this->host = $parts['host']; };
248 if (isset($parts['user'])) { $this->user = $parts['user']; };
249 if (isset($parts['pass'])) { $this->pass = $parts['pass']; };
250 if (isset($parts['port'])) { $this->port = $parts['port']; };
251 …if (isset($parts['path'])) { $this->path = $parts['path']; } else { $this->path = "/…
252 if (isset($parts['query'])) { $this->path .= '?'.$parts['query']; };
254 switch (strtolower($this->protocol)) {
256 return $this->fetch_http();
258 return $this->fetch_https();
260 $this->host = "";
261 return $this->fetch_file();
263 $message = sprintf("Unsupported protocol: %s", $this->protocol);
265 $this->error_message .= $message;
271 $res = $this->_head();
274 $this->code = $this->_extract_code($res);
276 return $this->_process_code($res);
283 if ($this->protocol == "https" && !isset($parts['port'])) {
284 $this->port = 443;
287 $res = $this->_head();
290 $this->code = $this->_extract_code($res);
292 return $this->_process_code($res);
297 $path = substr($this->url, 7);
300 $path = substr($this->url, 7);
308 $this->content = "";
309 $this->code = HTTP_OK;
313 $this->content = @file_get_contents($normalized_path);
314 $this->code = HTTP_OK;
320 $socket = $this->_connect();
324 $header = "GET ".$this->path." HTTP/1.1\r\n";
325 $header .= "Host: ".$this->host."\r\n";
327 $header .= "User-Agent: ".$this->user_agent."\r\n";
329 $header .= "Referer: ".$this->protocol."://".$this->host.$this->path."\r\n";
330 $header .= $this->_header_basic_authorization();
353 $socket = $this->_connect();
358 $header = "HEAD ".$this->path." HTTP/1.1\r\n";
359 $header .= "Host: ".$this->host."\r\n";
361 $header .= "User-Agent: ".$this->user_agent."\r\n";
364 $header .= "Referer: ".$this->protocol."://".$this->host.$this->path."\r\n";
366 $header .= $this->_header_basic_authorization();
391 switch ($this->code) {
394 $this->headers = $matches[1];
403 $this->content = @file_get_contents($this->url);
408 $this->redirects++;
409 if ($this->redirects > MAX_REDIRECTS) { return false; };
411 return $this->fetch($this->_fix_location($matches[1]));
413 $this->redirects++;
414 if ($this->redirects > MAX_REDIRECTS) { return false; };
418 return $this->fetch($this->_fix_location($matches[1]));
429 $this->headers = $matches[1];
430 $this->content = @file_get_contents($this->url);
435 $res = $this->_get();
437 $this->code = $this->_extract_code($res);
438 return $this->_process_code($res, true);
444 $this->headers = $matches[1];
445 $this->content = @file_get_contents($this->url);
449 error_log("Unrecognized HTTP result code:".$this->code);
455 if (!is_null($this->user) && $this->user != "") {
456 return sprintf("Authorization: Basic %s\r\n", base64_encode($this->user.":".$this->pass));