Fat-Free Framework: Web Class Reference

Fat-Free-Framework

Fat-Free Framework  3.1.0 API Reference

Wrapper for various HTTP utilities. More...

Inheritance diagram for Web:
Prefab

Public Member Functions

 mime ($file)
 
 acceptable ($list=NULL)
 
 send ($file, $mime=NULL, $kbps=0, $force=TRUE)
 
 receive ($func=NULL, $overwrite=FALSE, $slug=TRUE)
 
 progress ($id)
 
 engine ($arg='curl')
 
 subst (array &$old, $new)
 
 request ($url, array $options=NULL)
 
 minify ($files, $mime=NULL, $header=TRUE, $path='')
 
 rss ($url, $max=10, $tags=NULL)
 
 whois ($addr, $server='whois.internic.net')
 
 slug ($text)
 
 filler ($count=1, $max=20, $std=TRUE)
 

Public Attributes

const E_Request ='No suitable HTTP request engine found'
 

Protected Member Functions

 _curl ($url, $options)
 
 _stream ($url, $options)
 
 _socket ($url, $options)
 

Additional Inherited Members

- Static Public Member Functions inherited from Prefab
static instance ()
 

Detailed Description

Wrapper for various HTTP utilities.

Member Function Documentation

Web::_curl (   $url,
  $options 
)
protected

HTTP request via cURL

Returns
array
Parameters
$urlstring
$optionsarray
Web::_socket (   $url,
  $options 
)
protected

HTTP request via low-level TCP/IP socket

Returns
array
Parameters
$urlstring
$optionsarray
Web::_stream (   $url,
  $options 
)
protected

HTTP request via PHP stream wrapper

Returns
array
Parameters
$urlstring
$optionsarray
Web::acceptable (   $list = NULL)

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

Returns
array|string|FALSE
Parameters
$liststring|array
Web::engine (   $arg = 'curl')

Specify the HTTP request engine to use; If not available, fall back to an applicable substitute

Returns
string
Parameters
$argstring
Web::filler (   $count = 1,
  $max = 20,
  $std = TRUE 
)

Return chunk of text from standard Lorem Ipsum passage

Returns
string
Parameters
$countint
$maxint
$stdbool
Web::mime (   $file)

Detect MIME type using file extension

Returns
string
Parameters
$filestring
Web::minify (   $files,
  $mime = NULL,
  $header = TRUE,
  $path = '' 
)

Strip Javascript/CSS files of extraneous whitespaces and comments; Return combined output as a minified string

Returns
string
Parameters
$filesstring|array
$mimestring
$headerbool
$pathstring
Web::progress (   $id)

Return upload progress in bytes, FALSE on failure

Returns
int|FALSE
Parameters
$idstring
Web::receive (   $func = NULL,
  $overwrite = FALSE,
  $slug = TRUE 
)

Receive file(s) from HTTP client

Returns
array|bool
Parameters
$funccallback
$overwritebool
$slugbool
Web::request (   $url,
array  $options = NULL 
)

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

Returns
array|FALSE
Parameters
$urlstring
$optionsarray
Web::rss (   $url,
  $max = 10,
  $tags = NULL 
)

Retrieve RSS feed and return as an array

Returns
array|FALSE
Parameters
$urlstring
$maxint
$tagsstring
Web::send (   $file,
  $mime = NULL,
  $kbps = 0,
  $force = TRUE 
)

Transmit file to HTTP client; Return file size if successful, FALSE otherwise

Returns
int|FALSE
Parameters
$filestring
$mimestring
$kbpsint
$forcebool
Web::slug (   $text)

Return a URL/filesystem-friendly version of string

Returns
string
Parameters
$textstring
Web::subst ( array &  $old,
  $new 
)

Replace old headers with new elements

Returns
NULL
Parameters
$oldarray
$newstring|array
Web::whois (   $addr,
  $server = 'whois.internic.net' 
)

Retrieve information from whois server

Returns
string|FALSE
Parameters
$addrstring
$serverstring

The documentation for this class was generated from the following file:
  • web.php
Generated on Mon Aug 19 2013 21:27:55 for Fat-Free Framework by   doxygen 1.8.4