summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2007-10-04 01:05:31 +0000
committerUrban Müller2007-10-04 01:05:31 +0000
commitc1a9e173424c56c8b6e67d31a0b94aefc4896696 (patch)
tree2716e263750bdd77fce5b66650ea4fa1b227674d
parentdc2ad8fc00fdcb1e8086ee9a6e8d2ff28985eebf (diff)
downloaditools-c1a9e173424c56c8b6e67d31a0b94aefc4896696.tar.gz
itools-c1a9e173424c56c8b6e67d31a0b94aefc4896696.tar.bz2
itools-c1a9e173424c56c8b6e67d31a0b94aefc4896696.zip
documentation
-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())
{