1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Caching\Storages;
9:
10: use Nette;
11:
12:
13: /**
14: * @deprecated
15: */
16: class PhpFileStorage extends FileStorage
17: {
18: /** @var string */
19: public $hint;
20:
21:
22: /**
23: * Reads cache data from disk.
24: * @param array
25: * @return mixed
26: */
27: protected function readData($meta)
28: {
29: return array(
30: 'file' => $meta[self::FILE],
31: 'handle' => $meta[self::HANDLE],
32: );
33: }
34:
35:
36: /**
37: * Returns file name.
38: * @param string
39: * @return string
40: */
41: protected function getCacheFile($key)
42: {
43: return parent::getCacheFile(substr_replace(
44: $key,
45: trim(strtr($this->hint, '\\/@', '.._'), '.') . '-',
46: strpos($key, Nette\Caching\Cache::NAMESPACE_SEPARATOR) + 1,
47: 0
48: )) . '.php';
49: }
50:
51:
52: /**
53: * @return string
54: */
55: public function getDir()
56: {
57: return dirname(parent::getCacheFile(NULL));
58: }
59:
60: }
61: