mirror of
https://github.com/mosbth/cimage.git
synced 2025-01-16 18:48:14 +01:00
Add function getValue() to read from querystring.
This commit is contained in:
parent
1411adc828
commit
0f1f537b62
@ -107,6 +107,25 @@ function getDefined($key, $defined, $undefined)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get value of input from query string or else $undefined.
|
||||
*
|
||||
* @param mixed $key as string or array of string values to look for in $_GET.
|
||||
* @param mixed $undefined value to return when $key has no, or empty value in $_GET.
|
||||
*
|
||||
* @return mixed value as or $undefined.
|
||||
*/
|
||||
function getValue($key, $undefined)
|
||||
{
|
||||
$val = get($key);
|
||||
if (is_null($val) || $val === "") {
|
||||
return $undefined;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get value from config array or default if key is not set in config array.
|
||||
*
|
||||
@ -132,7 +151,7 @@ function getConfig($key, $default)
|
||||
*
|
||||
* @return void or array.
|
||||
*/
|
||||
function verbose($msg = null)
|
||||
function verbose($msg = null, $arg = "")
|
||||
{
|
||||
global $verbose, $verboseFile;
|
||||
static $log = array();
|
||||
@ -145,7 +164,15 @@ function verbose($msg = null)
|
||||
return $log;
|
||||
}
|
||||
|
||||
$log[] = $msg;
|
||||
if (is_null($arg)) {
|
||||
$arg = "null";
|
||||
} elseif ($arg === false) {
|
||||
$arg = "false";
|
||||
} elseif ($arg === true) {
|
||||
$arg = "true";
|
||||
}
|
||||
|
||||
$log[] = $msg . $arg;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user