Class HTTP
A class with HTTP-related helpers. Like Debug, this is more a bundle of methods than a class ;-)
Methods summary
public static
|
#
filename2url( mixed $filename )
Turns a local system filename into a URL by comparing it to the script filename |
public static
|
|
public static
|
|
public static
String
|
#
setGetVar( String $varname, String $varvalue, String $currentURL = null, String $separator = '&' )
Will try to include a GET parameter for an existing URL, preserving existing parameters and fragments. If no URL is given, falls back to $_SERVER['REQUEST_URI']. Uses parse_url() to dissect the URL, and http_build_query() to reconstruct it with the additional parameter. Converts any '&' (ampersand) URL parameter separators to the more XHTML compliant '&'. |
public static
|
|
public static
array
|
#
findByTagAndAttribute( string $content, array $attributes )
Search for all tags with a specific attribute, then return the value of that attribute in a flat array. |
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
String
|
#
sendRequest( mixed $host, mixed $path, mixed $query, mixed $port = 80 )
Send an HTTP request to the host. |
public static
string
|
#
sendPostRequest( string $host, string $path, array|string $data, string $name = null, string $query = '', string $port = 80, mixed $getResponse = true )
Send a HTTP POST request through fsockopen(). |
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
#
add_cache_headers(
Add the appropriate caching headers to the response, including If-Modified-Since / 304 handling. |
public static
|
|
public static
|
Magic methods summary
Properties summary
public static
mixed
|
$userName | |
public static
mixed
|
$password | |
protected static
integer
|
$cache_age | |
protected static
mixed
|
$modification_date | |
protected static
mixed
|
$etag |