diff options
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/helper.php b/lib/helper.php index 7423a9c..3dd6b69 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -21,44 +21,6 @@ function forceslash($url) return $url; } -function has($keychain) -{ - return _has($GLOBALS['CONFIG'], $keychain); -} -function _has($array, $keychain) -{ - if(!is_array($keychain)) - $keychain = explode('.', $keychain); - - $key = $keychain[0]; - if(!isset($array[$key])) - return false; - - if(count($keychain) == 1) - return true; - - return _has($array[$key], array_slice($keychain, 1)); -} - -function get($keychain, $default = null) -{ - return _get($GLOBALS['CONFIG'], $keychain, $default); -} -function _get($array, $keychain, $default) -{ - if(!is_array($keychain)) - $keychain = explode('.', $keychain); - - $key = $keychain[0]; - if(!isset($array[$key])) - return $default; - - if(count($keychain) == 1) - return $array[$key]; - - return _get($array[$key], array_slice($keychain, 1), $default); -} - function startswith($needle, $haystack) { return substr($haystack, 0, strlen($needle)) == $needle; |