![]() |
WiseLoop PHP Web Media Grabber 3.1.1
Advanced PHP web resources extractor
|
Public Member Functions | |
__construct ($processor, $url=null) | |
setUrl ($url) | |
getCurl () | |
getUrl () | |
getTagName () | |
setSearchString ($search) | |
getSearchString () | |
setFullTag ($fullTag) | |
getFullTag () | |
setTagContent ($tagContent) | |
getTagContent () | |
getSrcIni () | |
getGrabber () | |
setParentMedia ($media) | |
getParentMedia () | |
getExists () | |
getSize () | |
getContentType () | |
getResponse () | |
setAttribute ($name, $value, $persistent=false) | |
getAttribute ($name) | |
getAttributes () | |
setAttributes ($attributes) | |
hasAttributes () | |
getLocalDownloadFile () | |
getGrabbedUrl () | |
getLocalFileName () | |
download () | |
deleteDownload () | |
Private Member Functions | |
getHeaders () | |
getLocalCacheFile ($attribute) | |
getLocalDownloadUrl () | |
Private Attributes | |
$_urlIni | |
$_curl | |
$_fullTag | |
$_tagContent | |
$_searchString | |
$_headers | |
$_attributes | |
$_processor | |
$_parent |
WiseLoop Web Media Grabber Media class definition
An object of this class represents a downloadable web media resource; it can be anything: image, video, flash application, css file, javascript file, a document etc.
This class provides needed functions to handle web media such as getting HTML response headers, contents, size, content-type, url, getting and setting various attributes, downloading etc.
__construct | ( | $ | processor, |
$ | url = null |
||
) |
Constructor.
Creates a media object.
wlWmgProcessor | $processor | the parent media grabber processor |
string | $url | the initial media url |
deleteDownload | ( | ) |
Deletes the downloaded media from the localhost.
download | ( | ) |
Downloads the media to localhost.
getAttribute | ( | $ | name | ) |
Returns a various media attribute.
string | $name | the attribute name |
getAttributes | ( | ) |
Returns the media attributes array.
getContentType | ( | ) |
Returns the media HTTP content-type.
getExists | ( | ) |
Tests if the media url exists.
getFullTag | ( | ) |
Returns the full tag that envelopes the actual media url.
getGrabbedUrl | ( | ) |
Returns the grabbed media url - ie. if the media was downloaded, the local download url will be returned, else, the media internet url will be returned; practically this is the method that returns the media url to be used after grabbing.
getGrabber | ( | ) |
Returns the parent media grabber processor object that founded the current media.
getHeaders | ( | ) | [private] |
Returns and computes if necessary the cached HTTP response headers of the current media $_curl object.
getLocalCacheFile | ( | $ | attribute | ) | [private] |
Returns the media local cache file path for a specified attribute name.
string | $attribute | the attribute name |
getLocalDownloadFile | ( | ) |
Returns the media local download file path.
getLocalDownloadUrl | ( | ) | [private] |
Returns the media local download url.
getLocalFileName | ( | ) |
Computes and return the local file name for the current media.
getParentMedia | ( | ) |
Returns the parent media (ex. the image thumbnail that leads to current full size image media).
getResponse | ( | ) |
Returns the media HTTP response.
getSearchString | ( | ) |
Returns the media search string that was used to search through the grabbed targeted url page; obviously the search was successful, the current media was founded.
getSize | ( | ) |
Returns the media size (in bytes).
getSrcIni | ( | ) |
Returns the initial media url (it can be invalid if its path is relative to the grabbed targeted url page).
getTagContent | ( | ) |
Returns the inner HTML content of the full tag that envelopes the actual media url.
getTagName | ( | ) |
Computes and returns only the tag name that envelopes the media url.
getUrl | ( | ) |
Returns the media url string.
hasAttributes | ( | ) |
Tests if the current media has attributes.
setAttribute | ( | $ | name, |
$ | value, | ||
$ | persistent = false |
||
) |
Sets a various media attribute.
string | $name | the attribute name |
string | $value | the attribute value |
bool | $persistent | if the attribute should be saved in cache for future usage |
setAttributes | ( | $ | attributes | ) |
Sets the media attributes array.
array | $attributes | the new attributes |
setFullTag | ( | $ | fullTag | ) |
Sets the full tag that envelopes the actual media url.
string | $fullTag | the full tag string |
setParentMedia | ( | $ | media | ) |
Sets the parent media (ex. the image thumbnail that leads to current full size image media).
wlWmgMedia | $media |
setSearchString | ( | $ | search | ) |
Sets the media search string
string | $search | the search string |
setTagContent | ( | $ | tagContent | ) |
Sets the inner HTML content of the full tag that envelopes the actual media url.
string | $tagContent | the tag content |
setUrl | ( | $ | url | ) |
Sets the media url.
string | $url | the url string |
$_attributes [private] |
Type: array - various cached attributes for the current media (ex. width and height for images)
$_curl [private] |
Type: wlCurl - the curl object for the current media
$_fullTag [private] |
Type: string - the full tag description that envelopes the actual media url
$_headers [private] |
Type: array - the cached HTTP response headers returned by the $_curl object
$_parent [private] |
Type: wlWmgMedia - the parent media (ex. the image thumbnail that leads to current full size image media)
$_processor [private] |
Type: wlWmgProcessor - the parent media grabber processor object that founded the current media
$_searchString [private] |
Type: string - the string that was used to search through the grabbed targeted url page; obviously the search was successful, the current media was founded
$_tagContent [private] |
Type: string - the inner HTML of the $_fullTag
$_urlIni [private] |
Type: string - the initial media url (it can be invalid if its path is relative to the grabbed targeted url page)