/http_get.php

Description

This script implements utility functions for retrieving data using HTTP requests.

  • copyright: 2010, Phorum Development Team
  • license: Phorum
Functions
phorum_api_http_get (line 59)

This function can be used to retrieve data from a URL using an HTTP GET request.

The way in which data can be retrieved for URLs, depends a lot on the features and the configuration for PHP on the system. This function will try to autodetect a way that will work for the running system automatically.

  • return: The data that was loaded from the URL or NULL if an error occurred. The function phorum_api_strerror() can be used to retrieve information about the error which occurred.
string phorum_api_http_get (string $url, [string $method = NULL])
  • string $url: The URL to retrieve.
  • string $method: The method to use for retrieving the data. By default, this function will try to autodetect a working method. Providing a $method parameter is mostly useful for debugging purposes. Available methods (in the order in which they are probed in the code) are:
    • curl: using the curl library (requires extension "curl")
    • socket: using PHP socket programming (requires extension "sockets")
    • file: using fopen() (requires option "allow_url_fopen" to be enabled)
phorum_api_http_get_analyze (line 415)

A helper function for phorum_api_http_get() to determine what to do with a no "200 OK" response from the web server.

  • return: The return array either contains the fields "error" and "fatal" (if there was some error) or the field "redirect" (if a new URL has to be requested).
array phorum_api_http_get_analyze (string $requested_url, string $code, string $header)
  • string $requested_url
  • string $code
  • string $header
phorum_api_http_get_supported (line 507)

Check if platform support is available for retrieving files via HTTP using phorum_api_http_get().

  • return: TRUE in case files can be retrieving using HTTP, FALSE otherwise.
boolean phorum_api_http_get_supported ()

Documentation generated on Sat, 11 Jan 2014 01:45:51 -0600 by phpDocumentor 1.4.3