diff options
author | MaZderMind | 2015-03-31 17:16:40 +0200 |
---|---|---|
committer | MaZderMind | 2015-03-31 17:16:40 +0200 |
commit | 3de36d7a63fe91127f3413d58004bbd6505864a3 (patch) | |
tree | 4cc04b1e7a4567dbfa3b752f1791695f275771fd /lib | |
parent | c01f7979db801aca3cd42234cc4a7fafaec0a9cd (diff) |
Remove Global has/get
Diffstat (limited to 'lib')
-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; |