计算缓存名称

@param string $key
@access private
@return string
4018
private function _filename($key)
    {
        if (true == ($dir_pos = strrpos($key, '/'))) {
            // 有子目录，也可能有多层子目录。
            $cache_name = substr($key, $dir_pos + 1);

            // 缓存目录
            $cache_dir = APP_PATH . '/' . Config::get('cache_dir') . substr($key, 0, $dir_pos) . '/';

            // 递归创建文件夹
            if (!is_dir($cache_dir)) {
                mkdir($cache_dir, 0777, true);
            }
        } else {
            // 无子目录
            $cache_name = $key;
            $cache_dir  = APP_PATH . '/' . Config::get('cache_dir');
        }

        // 缓存文件名
        return $cache_dir . trim($cache_name) . '^' . md5($cache_name) . '.cache';
    }
924233
protected static function getFriendlyKeyName(string $key): string
    {
        if (ctype_upper(str_replace('_', '', $key))) {
            $key = strtolower($key);
        }

        return ucfirst(str_replace('_', ' ', snake_case($key)));
    }
60879
public static function namespaceAsArrayKey(string $key) : string
    {
        $keys = \explode('\\', $key);
        $className = \end($keys);

        return self::camelCaseToUnderscore($className);
    }
1230803
public function key($key)
    {
        if (empty($key)) {
            return false;
        }

        $key = Inflector::underscore(str_replace(
            [DIRECTORY_SEPARATOR, '/', '.', '<', '>', '?', ':', '|', '*', '"'],
            '_',
            (string)$key
        ));

        return $key;
    }
661841
public static function normalizeKey($key)
    {
        $key = strtr(strtolower($key), '_', '-');
        if (strpos($key, 'http-') === 0) {
            $key = substr($key, 5);
        }

        return $key;
    }
1046828
public function getFileName($key)
    {
        if(is_callable($this->saveFileNameCallback))
        {
            // 使用回调处理
            return call_user_func($this->saveFileNameCallback, $this->savePath, $key);
        }
        else
        {
            // 默认处理使用MD5
            return FileUtil::path($this->savePath, md5($key));
        }
    }
1030559
public function getKey($key) {
		$out = NULL;
		if ($this->hasKey($key)) {
			$out = $this->key[$key];
			unset($this->key[$key]);
		}
		return $out;
	}
551214
private function getAttribute($key)
    {
        return (isset($this->attributes[$key]) && $this->attributes[$key]) ? $this->attributes[$key] : '';
    }
837610
public function getNameByKey($key)
    {
        return (array_key_exists($key, $this->_languages)) ? $this->_languages[$key] : null;
    }
1166840
public function attribute(string $key)
    {
        if (! isset($this->attributes[$key])) {
            return '';
        }

        return $this->attributes[$key];
    }
1082166
public function getKeyValue($key)
    {
        foreach ($this->array as $k => $v) {
            if (strtolower($key) == strtolower($k)) {
                return $v;
            }
        }

        return '';
    }
584332
public function sanitizeKey( $key ) {
		$key = trim( strtolower( preg_replace( '/-/', '', $key ) ) );
		$key = implode( '-', str_split( $key, 8 ) );
		return sanitize_key( $key );
	}
274768
private function camelCase($key)
    {
        $parts = explode('_', $key);

        foreach ($parts as $i => $part) {
            if ($i !== 0) {
                $parts[$i] = ucfirst($part);
            }
        }

        return str_replace(' ', '', implode(' ', $parts));
    }
203325
public function header(string $key): string
    {
        if (array_key_exists($key, $this->headers)) {
            return $this->headers[$key];
        }

        return '';
    }
1091701
public function getSessionKeyName($key)
    {
        $key_name = $key;
        if (! empty( $this->session_base_name )) {
            $key_name = $this->session_base_name.'_'.$key_name;
        }

        return $key_name;
    }
768026
public static function get( $key ) {

		if ( isset( self::$config[ strtolower( $key ) ] ) ) {
			return self::$config[ strtolower( $key ) ];
		} else {
			return '';
		}

	}
599809
public function key(string $key): string
    {
        // NOTE: In WordPress, keys that begin with `_`
        // are not displayed in the list of Custom Fields.

        if (!$key) { // Is the key empty?
            return ''; // Explicitly.
        }
        if (mb_strpos($key, '_') === 0) {
            $key    = mb_substr($key, 1);
            $prefix = '_'.$this->App->Config->©brand['©var'].'_';
        } else {
            $prefix = $this->App->Config->©brand['©var'].'_';
        }
        return $prefix.$key;
    }