Gets data from an url, or its cache file. |
Signature: getData($url) |
Parameters:
String url - The url of the data.
|
Returns:
String - The data at the specified url.
|
Given an url, returns the path to the cache file. Uses an md5 hash of the url. This can be overridden if a different approach is required. |
Signature: getCacheFileName($url) |
Parameters:
String url - The url of the data.
|
Returns:
String - The cache file name.
|
Establishes a connection, given an url. |
Signature: establishConnection($url) |
Parameters:
String url - The url of the data.
|
Gets data from an url and caches a copy of the data. |
Signature: fromURL($url, $cacheFile) |
Parameters:
String url - The url of the data.
String cacheFile - The cache file path.
|
Returns:
String - The contents of the url.
|
Get text from cache file. |
Signature: fromCache($cacheFile) |
Parameters:
String cacheFile - The file path.
|
Returns:
String - The text contained in the file, or an empty string.
|
Get text from an url or file. |
Signature: fromFile($filename) |
Parameters:
String filename - The url or file path.
|
Returns:
String - The text contained in the file, or an empty string.
|