summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class33
1 files changed, 17 insertions, 16 deletions
diff --git a/it_url.class b/it_url.class
index c94f4af..d279ab7 100644
--- a/it_url.class
+++ b/it_url.class
@@ -214,9 +214,9 @@ function is_reachable($timeout = 5)
/**
* Get simple URL with timeout. Can be called statically
* @p parameter array with the following keys
- * - url: url to get, defaults to constructor URL
- * - timeout: timeout per read in milliseconds, defaults to 5000
- * - data: post data array with key-value pairs
+ * @p['url']: url to get, defaults to constructor URL
+ * @p['timeout']: timeout per read in milliseconds, defaults to 5000
+ * @p['data']: POST data array with key-value pairs
* @return contents of resulting page, considering redirects, excluding headers, or false on error
*/
function get($p=null, $timeout=5000)
@@ -319,8 +319,8 @@ function get($p=null, $timeout=5000)
/**
* Construct a local file name to cache an URL. Named args:
- * @url remote url to get
- * @cachedir path to cache directory
+ * @p['url'] remote url to get
+ * @p['cachedir'] path to cache directory
*/
function get_cache_filename($p)
{
@@ -335,17 +335,18 @@ function get_cache_filename($p)
/**
- * Store contents of url in a file and return file name. Provides locking. Call statically.
- * Requires www writeable var/urlcache in your service dir. Params in assoc array:
- * @p['url'] url to get
- * @p['timeout'] timeout in milliseconds, default 10000
- * @p['maxage'] maximum age of cache entries in seconds, default 86400
- * @p['cleanbefore'] maximum daytime when attempting cleanup, default 7200
- * @p['preprocess'] callback function (or array for methods) to change received file or array('function' => ..., 'in' => $src, 'out' => $dst, ...) with callback function plus args
- * @p['safety'] value 0 means dont generate alert, value 1 means generate alerts on timeouts and failures
- * @p['keepfailed'] keep old versions of files if download fails (sending alerts conservatively)
- * @p['cachedir'] directory to store cache files in. NO TRAILING SLASH
- * @p['it_error'] parameters for it_error
+ * Store contents of url in a file and return file name. Threadsafe: Provides locking. Called statically.
+ * Requires webserver writeable directory in $p['cachdedir']. Params in associative array p:
+ * @p['url'] url to get
+ * @p['cachedir'] path to cache directory
+ * @p['timeout'] timeout in milliseconds, default 10000
+ * @p['maxage'] maximum age of cache entries in seconds, default 86400
+ * @p['cleanbefore'] maximum daytime when attempting cleanup, default 7200
+ * @p['preprocess'] callback function (or array for methods) to change received file or array('function' => ..., 'in' => $src, 'out' => $dst, ...) with callback function plus args
+ * @p['safety'] value 0 means dont generate alert, value 1 means generate alerts on timeouts and failures
+ * @p['keepfailed'] keep old versions of files if download fails (sending alerts conservatively)
+ * @p['cachedir'] directory to store cache files in. NO TRAILING SLASH
+ * @p['it_error'] parameters for it::error()
*/
function get_cache($p = array())
{