WiseLoop PHP Web Media Grabber 3.1.1
Advanced PHP web resources extractor
wlCurl Class Reference

Public Member Functions

 __construct ($url)
 setUrl ($url)
 getUrl ()
 setProxy ($proxy)
 getProxy ()
 setCookie ($cookie)
 getCookie ()
 setLogFilePath ($logFilePath)
 getLogFilePath ()
 addLogEntry ($message, $asTitle=false)
 getExists ()
 getContents ()
 getHeaders ()
 setHeaders ($data)
 getBrowserCookie ()
 getLength ()
 getContentType ()
 getResponse ()
 parseUrl ()
 getUrlScheme ()
 getUrlDomain ()
 getUrlHost ()
 getUrlHostName ()
 getUrlDomainAndPath ()
 getUrlPath ()

Static Public Member Functions

static isCurlEnabled ()
static isFopenEnabled ()
static getUnableMessage ()
static normalizeUrl ($url)

Private Member Functions

 curlInit ($forHeadersOnly=false)

Private Attributes

 $_url
 $_proxy
 $_headers
 $_contents
 $_cookie
 $_logFilePath

Detailed Description

WiseLoop Web Grabber cURL class definition
This class provides a set of handling methods for a certain url.

Author:
WiseLoop

Constructor & Destructor Documentation

__construct ( url)

Constructor.
Creates a wlCurl object.

Parameters:
string$urlthe url
Returns:
wlCurl

Member Function Documentation

addLogEntry ( message,
asTitle = false 
)

Adds and entry to the verbose log.

Parameters:
string$message
bool$asTitle
Returns:
void
curlInit ( forHeadersOnly = false) [private]

Prepares a cURL handle for the current url; the returning cURL handle will behave like a real browser.

Parameters:
bool$forHeadersOnlyspecifies if the returning cURL handler is intended to be used only for getting the current url headers
Returns:
bool|resource the cURL handle on success, false on errors
getBrowserCookie ( )

Computes and returns a compatible browser cookie string from the current headers.

Returns:
string
getContents ( )

Reads and return the entire content of the current url.

Returns:
string the $_url contents
getContentType ( )

Returns the content type of the current url.

Returns:
string
getCookie ( )

Returns the cookie string of the current Curl object.

Returns:
string
getExists ( )

Checks if the current url exists.

Returns:
bool if $_url exists
getHeaders ( )

Returns the headers of the current url.

Returns:
array
getLength ( )

Returns the content length of the current url.

Returns:
float the content length, or -1 if the size could not be measured
getLogFilePath ( )

Returns the verbose log file path.

Returns:
string
getProxy ( )

Returns the proxy address of the current Curl object.

Returns:
string
getResponse ( )

Returns the response header line of the current url.

Returns:
string
static getUnableMessage ( ) [static]

Returns a message that explains why the local machine is unable to handle cURL functions, or an empty string if it is able to.

Returns:
bool|string
getUrl ( )

Returns the url string of the Curl object.

Returns:
string
getUrlDomain ( )

Returns the internet domain name of the current url in the following form: scheme://subdomain.domainname.extension (ie. http://www.wiseloop.com).

Returns:
string
getUrlDomainAndPath ( )

Returns the domain name and the path location where the current url resource is located. (ie. for the url http://www.wiseloop.com/images/animage.jpg, the method will return http://www.wiseloop/images).

Returns:
string
getUrlHost ( )

Returns the host name of the current url in the following form scheme://domainname.extension (ie. http://wiseloop.com).

Returns:
string
getUrlHostName ( )

Returns the host name of the current url in the following form domainname.extension (ie. wiseloop.com).

Returns:
string
getUrlPath ( )

Returns the path location where the current url is located.

Returns:
string
getUrlScheme ( )

Returns the internet scheme of the current url in the following form: scheme://, or false if no scheme is present (ie. http://).

Returns:
string
static isCurlEnabled ( ) [static]

Tests if "php_curl" extension is enabled.

Returns:
bool
static isFopenEnabled ( ) [static]

Tests if "allow_url_fopen" setting from php.ini is on.

Returns:
bool
static normalizeUrl ( url) [static]

Normalizes the given url.

Parameters:
string$url
Returns:
string
parseUrl ( )

Parses the current url string and returns the url parts (scheme, port, username, password, sub-domain, domain, extension, host, path, query, fragment)

Returns:
array
setCookie ( cookie)

Sets the cookie string to be sent when making the request.

Parameters:
string$cookie
Returns:
void
setHeaders ( data)

Sets the headers of the current url.

Parameters:
array$data
Returns:
void
setLogFilePath ( logFilePath)

Sets the verbose log file path.

Parameters:
string$logFilePath
Returns:
void
setProxy ( proxy)

Sets the proxy address for the Curl object. If empty or null, no proxy will be used. Proxy address is considered only if php_curl module is active for the current PHP configuration.

Parameters:
string$proxy
Returns:
void
See also:
isCurlEnabled
setUrl ( url)

Sets the url for the Curl object.

Parameters:
string$url
Returns:
void

Field Documentation

$_contents [private]

Type: string the cached contents

$_cookie [private]

Type: string the cookie to be sent on request

$_headers [private]

Type: array the cached headers

$_logFilePath [private]

Type: string the verbose log file

$_proxy [private]

Type: string the proxy address that will be used to make the request

$_url [private]

Type: string the current url


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables