根据缓存数据的名称,获取缓存文件名

@param string $key 缓存数据的名称(Key)
@return array [加密后的名称,缓存文件全路径名]
424970
private function getFile(string $key): array
    {
        if (!preg_match('/^\w+$/', $key)) {
            $key = md5($key);
        }

        // 返回唯一Key,缓存内容的文件名,缓存语句的文件名
        return [$key, $this->path() . $key . '.cache', $this->path() . $key . '.sql'];
    }
155828
public function isArray($key)
    {
        $fieldMeta = $this->getMeta();
        return isset($fieldMeta[$key]) && substr($fieldMeta[$key]->name, -strlen('[]')) === '[]';
    }
761724
public static function deconstructIniKey($key) {
		$res = [
			'plugin' => null,
			'prefix' => null
		];

		if (strpos($key, '.') !== false) {
			list($res['plugin'], $key) = explode('.', $key);
		}
		if (strpos($key, '/') !== false) {
			list($res['prefix'], $key) = explode('/', $key);
		}
		$res['controller'] = $key;
		return $res;
	}
1221067
public function get($key)
    {
        $filename = $this->getKeyCode($key);

        if ($this->fileExists($filename)) {
            $value = $this->read($filename);
        } else {
            return null;
        }

        return json_decode($value, true);
    }
777751
private function getFileNameForKey($key)
    {
        return $this->getDir().strtr($this->format, ['%key%' => $key, '%env%' => $this->environment]);
    }
746682
protected function _getFileName($key)
    {
        $key = strtr($key, ':', '/');
        $pos = strrpos($key, '/');

        if ($pos !== false && strlen($key) - $pos - 1 === 32) {
            $prefix = substr($key, 0, $pos);
            $md5 = substr($key, $pos + 1);
            $shard = '';

            for ($i = 0; $i < $this->_level; $i++) {
                $shard .= '/' . substr($md5, $i + $i, 2);
            }
            $key = $prefix . $shard . '/' . $md5;
        }

        if ($key[0] !== '/') {
            $key = '/' . $key;
        }

        return $this->alias->resolve($this->_dir . $key . $this->_ext);
    }
545294
public function getExtensions($key) {
		if ($this->extensions->has($key)) {
			return $this->extensions->get($key);
		}
		
		return [];
	}
817489
protected function getFilename(string $key): string
    {
        $sub = \substr(\hash('sha256', $key), 0, 2);

        return $this->directory . '/' . $sub . '/' . \base64_encode($key) . self::EXTENSION;
    }
466039
private function read($key)
    {
        $fname = $this->getObjectPath($key);
        if (file_exists($fname)) {
            $content = file_get_contents($fname);
            return unserialize($content);
        }
        return null;
    }
987037
public function getFilename(string $key): string
    {
        if (!$this->validate($key)) {
            throw new \InvalidArgumentException('The key provided (' . $key . ') is not valid! It may contain only the following characters: "a-z", "0-9", ".", "/", "-" and "_".');
        }
        if ($this->filenameProtocol === null) {
            throw new \Exception('No filenameProtocol specified!');
        }
        return $this->filenameProtocol . '://' . $key;
    }
1046060
protected function resolveKey($key)
    {
        list($key, $validates) = explode('.', $key);

        $validates = explode(':', $validates);
        $validator = $validates[0];
        $attributes = count($validates) > 1 ? explode(';', $validates[1]) : [];

        $negative = false;
        if ($validator[0] === '!') {
            $negative = true;
            $validator = substr($validator, 1);
        }

        return [$key, $validator, $attributes, $negative];
    }
550128
protected function parseKey(string $key): array
	{
		return (strpos($key, '.') === false) ? [$key, null] : explode('.', $key, 2);
	}
649258
public function getHelperName($key)
    {
        $helpers = $this->getOption('helpers', []);

        return is_array($helpers) && isset($helpers[$key])
            ? $helpers[$key]
            : $key;
    }
669448
protected function parseKey($key) {
        $key = trim($key);
        $data = explode('.', $key);
        $group = trim($data[0]);
        if (1 == count($data)) {
            return [$group, null];
        }

        return [$group, $data[1]];
    }
1043506
private function getFilename($key)
    {
        $filename = ($this->ismd5 == true) ? md5($key) : $key;
        if (!is_dir($this->htmlPath)) return false;
        return $this->htmlPath . '/' . $filename . '.htm';
    }
897158
public function loadByKey($key)
    {
        $configuration = new Configuration();
        require $key;
        $vars = get_defined_vars();
        unset($vars['configuration']);
        unset($vars['key']);
        foreach ($vars as $name => $value) {
            $configuration->{$name} = $value;
        }

        return $configuration;
    }
61656
private function getArrayKey($key)
    {
        $data = $this->__toArray();

        $cases = [
            $key,
            $this->snakeCase($key),
            lower($this->snakeCase($key)),
            $this->camelCase($key),
            $this->kebabCase($key),
            lower($this->kebabCase($key)),
            $this->stringCase($key),
            lower($this->stringCase($key)),
            lower($key),
        ];

        $data = $this->filter(function ($value, $key) use ($cases) {
            return array_search($key, $cases) !== false ||
                array_search(lower($key), $cases) !== false;
        })
            ->keys()
            ->first();

        return is_string($data) ? $data : static::NOT_FOUND;
    }