Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

  • DevNullStorage
  • FileJournal
  • FileStorage
  • MemcachedStorage
  • MemoryStorage
  • PhpFileStorage

Interfaces

  • IJournal
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  *
 6:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * For the full copyright and license information, please view
 9:  * the file license.txt that was distributed with this source code.
10:  */
11: 
12: namespace Nette\Caching\Storages;
13: 
14: use Nette;
15: 
16: 
17: /**
18:  * PHP files cache storage.
19:  *
20:  * @author     David Grudl
21:  */
22: class PhpFileStorage extends FileStorage
23: {
24:     /** @var string */
25:     public $hint;
26: 
27: 
28:     /**
29:      * Reads cache data from disk.
30:      * @param  array
31:      * @return mixed
32:      */
33:     protected function readData($meta)
34:     {
35:         return array(
36:             'file' => $meta[self::FILE],
37:             'handle' => $meta[self::HANDLE],
38:         );
39:     }
40: 
41: 
42:     /**
43:      * Returns file name.
44:      * @param  string
45:      * @return string
46:      */
47:     protected function getCacheFile($key)
48:     {
49:         return parent::getCacheFile(substr_replace(
50:             $key,
51:             trim(strtr($this->hint, '\\/@', '.._'), '.') . '-',
52:             strpos($key, Nette\Caching\Cache::NAMESPACE_SEPARATOR) + 1,
53:             0
54:         )) . '.php';
55:     }
56: 
57: }
58: 
Nette Framework 2.0.11 API API documentation generated by ApiGen 2.8.0