@param string|int $key
@param bool       $returnIfFound If true, the map value is returned if found. Otherwise TRUE is returned.

@return bool|string True/False or the map value if $returnIfFound is TRUE
354564
public function contains( $key, $returnIfFound = true )
    {
        if ( null !== ( $_value = $this->get( $key ) ) )
        {
            if ( true !== $returnIfFound )
            {
                $_value = true;
            }

            return $_value;
        }

        return false;
    }
377466
public function isLast($key)
	{
		if ($this->rows && $this->count())
		{
			return $key == array_slice($this->rows, -1, 1)[0]->getPkValue();
		}

		return false;
	}
106771
public static function post($key = false) {

        if (isset($_POST)) {

            if ($key) {

                return $_POST[$key];
            }

            return $_POST;
        }

        return false;
    }
817934
protected function isDeferred(/*# string */ $key)/*# : array */
    {
        $res = [];
        if (isset($this->defer[$key])) {
            $res['expire'] = $this->defer[$key]->getExpiration()->getTimestamp();
        }
        return $res;
    }
488744
public function getReturnUrls(string $key = null)
    {
        return $key
            ? $this->returnUrls[$key] ?? null
            : $this->returnUrls;
    }
815205
protected function getValueFromDefinition($key)
    {
        return (isset($this->definition) && !empty($this->definition[$key])) ? $this->definition[$key] : false;
    }
552808
public function getString($key)
    {
        
        if (array_key_exists($key, $this->dictionary)) {
            return $this->dictionary[$key];
        } else {
            return false;
        }
    }
16643
public function arrayGet($arr, $key, $fallback = null)
    {
        if (is_array($arr)) {
            if (array_key_exists($key, $arr)) {
                return $arr[$key];
            } else {
                return $fallback;
            }
        } else {
            trigger_error("Auth_OpenID::arrayGet (key = ".$key.") expected " .
                          "array as first parameter, got " .
                          gettype($arr), E_USER_WARNING);

            return false;
        }
    }
956274
public function incr($key)
    {
        if ($this->isMappedKey($key)) {
            return false;
        }
        return $this->getDriver()->incr($key);
    }
1140800
public function get($key)
    {
        if (isset($this->storage[$key])) {
            return $this->storage[$key];
        }

        $file = $this->findFile($key);
        if ($file === false) {
            return false;
        }

        if ($file === 0) {
            return null;
        }

        return fopen($file, 'r');
    }
908777
public function do_get($key)
    {
        /** @var \ManaPHP\DbInterface $db */
        $db = $this->_di->getShared($this->_db);

        $r = $db->query($this->_source)->whereEq('hash', md5($key))->first();
        if ($r && $r['expired_time'] > time()) {
            return $r['value'];
        } else {
            return false;
        }
    }
704051
public function get(string $key)
    {
        if (empty($key) || !$this->isEnable()) {
            return false;
        }

        $value = $this->read();
        if (!is_array($value) || !isset($value[$key])) {
            return false;
        }

        return $value[$key];
    }
161199
public static function in($value, array $array, $returnKey = false)
    {
        $inArray = in_array($value, $array, true);

        if ($returnKey) {
            if ($inArray) {
                return array_search($value, $array, true);
            }

            return null;
        }

        return $inArray;
    }
1302295
public static function get(array $array, $key, $fallback = null)
    {
        $keys = explode('.', $key);
        foreach($keys as $key) {
            if(!isset($array[$key])) {
                return $fallback;
            }
            $array = $array[$key];
        }

        return $array;
    }
576268
public function get($key) {
		
		if ($this->useFallback) {
			$filename = $this->getFileName($key);
			
			if (is_readable($filename)) {
				$fp = fopen($filename, "r");
				$timeout = fgets($fp);
					
				if ($timeout > time() || $timeout==0) {
					$contents = "";
					while (!feof($fp)) {
						$contents .= fread($fp, 65536);
					}
					fclose($fp);
					$value = unserialize($contents);
					//$this->log->trace("Retrieving key '$key' from file cache: value returned:".var_export($value, true));
					if ($this->log) {
						$this->log->trace("Retrieving key '$key' from file cache.");
					}
					return $value;
				} else {
					fclose($fp);
					unlink($filename);
					if ($this->log) {
						$this->log->trace("Retrieving key '$key' from file cache: key outdated, cache miss.");
					}
					return null;
				}
			} else {
				if ($this->log) {
					$this->log->trace("Retrieving key '$key' from file cache: cache miss.");
				}
				return null;
			}
		}
		
		// If not fallback
	
		$success = false;
		$value = apc_fetch($key, $success);
	
		if ($success) {
			if ($this->log) {
				$this->log->trace("Retrieving key '$key' from file cache.");
			}
			return $value;
		} else {
			if ($this->log) {
				$this->log->trace("Retrieving key '$key' from file cache: cache miss");
			}
			return null;
		}
	}
1346442
public function getBool(string $key, bool $default = false): bool
    {
        $value = $this->get($key, $default);
        if (is_string($value)) {
            $value = strtolower($value);
        }
        return in_array($value, [1, true, '1', 'true', 'yes', 'on'], true);
    }
991317
protected function getVal($key, $show=TRUE)
    {
      if (!($this->credentials instanceof CredentialsUser)) {
        $content = json_decode(file_get_contents(self::$credentials_opts['path']));
      } else {
        $content = $this->credentials;
      }

      if (!array_key_exists($key, get_object_vars($content))) {
        return false;
      }

      if (is_array($content->{$key})) {
        return implode(",", $content->{$key});
      }
            
      return $content->{$key};
    }