public static function cache($key = null, $value = null)
    {
        if ($key === null && $value === null) {
            // read all
            return static::$_cache;
        } elseif ($key !== null && $value === null) {
            // read key
            if (isset(static::$_cache[$key])) {
                return static::$_cache[$key];
            }

            return null;
        }
        if ($key !== null && $value !== null) {
            // write key
            static::$_cache[$key] = $value;

            return $value;
        } else {
            // search key for given value
            if (!empty(static::$_cache)) {
                foreach (static::$_cache as $k => $v) {
                    if ($v === $value) {
                        return $k;
                    }
                }
            }

            return null;
        }
    }