PHP Class Web

Inheritance: extends Base
Mostra file Open project: bcosca/fatfree-core Class Usage Examples

Protected Properties

Property Type Description
$wrapper @}

Public Methods

Method Description
acceptable ( $list = NULL ) : array | string | FALSE Return the MIME types stated in the HTTP Accept header as an array; If a list of MIME types is specified, return the best match; or FALSE if none found
engine ( $arg = 'curl' ) : string Specify the HTTP request engine to use; If not available, fall back to an applicable substitute
filler ( $count = 1, $max = 20, $std = TRUE ) : string Return chunk of text from standard Lorem Ipsum passage
mime ( $file ) : string Detect MIME type using file extension
minify ( $files, $mime = NULL, $header = TRUE, $path = NULL ) : string Strip Javascript/CSS files of extraneous whitespaces and comments; Return combined output as a minified string
progress ( $id ) : integer | FALSE Return upload progress in bytes, FALSE on failure
receive ( $func = NULL, $overwrite = FALSE, $slug = TRUE ) : array | boolean Receive file(s) from HTTP client
request ( $url, array $options = NULL ) : array | FALSE Submit HTTP request; Use HTTP context options (described in http://www.php.net/manual/en/context.http.php) if specified; Cache the page as instructed by remote server
rss ( $url, $max = 10, $tags = NULL ) : array | FALSE Retrieve RSS feed and return as an array
send ( $file, $mime = NULL, $kbps, $force = TRUE, $name = NULL, $flush = TRUE ) : integer | FALSE Transmit file to HTTP client; Return file size if successful, FALSE otherwise
slug ( $text ) : string Return a URL/filesystem-friendly version of string
subst ( array &$old, $new ) : null Replace old headers with new elements
whois ( $addr, $server = 'whois.internic.net' ) : string | FALSE Retrieve information from whois server

Protected Methods

Method Description
_curl ( $url, $options ) : array HTTP request via cURL
_socket ( $url, $options ) : array HTTP request via low-level TCP/IP socket
_stream ( $url, $options ) : array HTTP request via PHP stream wrapper

Method Details

_curl() protected method

HTTP request via cURL
protected _curl ( $url, $options ) : array
$url string
$options array
return array

_socket() protected method

HTTP request via low-level TCP/IP socket
protected _socket ( $url, $options ) : array
$url string
$options array
return array

_stream() protected method

HTTP request via PHP stream wrapper
protected _stream ( $url, $options ) : array
$url string
$options array
return array

acceptable() public method

Return the MIME types stated in the HTTP Accept header as an array; If a list of MIME types is specified, return the best match; or FALSE if none found
public acceptable ( $list = NULL ) : array | string | FALSE
$list string|array
return array | string | FALSE

engine() public method

Specify the HTTP request engine to use; If not available, fall back to an applicable substitute
public engine ( $arg = 'curl' ) : string
$arg string
return string

filler() public method

Return chunk of text from standard Lorem Ipsum passage
public filler ( $count = 1, $max = 20, $std = TRUE ) : string
$count int
$max int
$std bool
return string

mime() public method

Detect MIME type using file extension
public mime ( $file ) : string
$file string
return string

minify() public method

Strip Javascript/CSS files of extraneous whitespaces and comments; Return combined output as a minified string
public minify ( $files, $mime = NULL, $header = TRUE, $path = NULL ) : string
$files string|array
$mime string
$header bool
$path string
return string

progress() public method

Return upload progress in bytes, FALSE on failure
public progress ( $id ) : integer | FALSE
$id string
return integer | FALSE

receive() public method

Receive file(s) from HTTP client
public receive ( $func = NULL, $overwrite = FALSE, $slug = TRUE ) : array | boolean
$func callback
$overwrite bool
$slug callback|bool
return array | boolean

request() public method

Submit HTTP request; Use HTTP context options (described in http://www.php.net/manual/en/context.http.php) if specified; Cache the page as instructed by remote server
public request ( $url, array $options = NULL ) : array | FALSE
$url string
$options array array
return array | FALSE

rss() public method

Retrieve RSS feed and return as an array
public rss ( $url, $max = 10, $tags = NULL ) : array | FALSE
$url string
$max int
$tags string
return array | FALSE

send() public method

Transmit file to HTTP client; Return file size if successful, FALSE otherwise
public send ( $file, $mime = NULL, $kbps, $force = TRUE, $name = NULL, $flush = TRUE ) : integer | FALSE
$file string
$mime string
$kbps int
$force bool
$name string
$flush bool
return integer | FALSE

slug() public method

Return a URL/filesystem-friendly version of string
public slug ( $text ) : string
$text string
return string

subst() public method

Replace old headers with new elements
public subst ( array &$old, $new ) : null
$old array array
$new string|array
return null

whois() public method

Retrieve information from whois server
public whois ( $addr, $server = 'whois.internic.net' ) : string | FALSE
$addr string
$server string
return string | FALSE

Property Details

$wrapper protected_oe property

@}
protected $wrapper