Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Cache
  • OutputHelper

Interfaces

  • IBulkReader
  • IStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class Cache

Implements the cache for a application.

Nette\Caching\Cache uses Nette\SmartObject
Namespace: Nette\Caching
Located at Caching/Cache.php
Methods summary
public
# __construct( Nette\Caching\IStorage $storage, $namespace = null )
public Nette\Caching\IStorage
# getStorage( )

Returns cache storage.

Returns cache storage.

Returns

Nette\Caching\IStorage
IStorage
public string
# getNamespace( )

Returns cache namespace.

Returns cache namespace.

Returns

string
string
public Nette\Caching\Cache
# derive( string $namespace )

Returns new nested cache object.

Returns new nested cache object.

Parameters

$namespace

Returns

Nette\Caching\Cache
static
public mixed
# load( mixed $key, callable $fallback = null )

Reads the specified item from the cache or generate it.

Reads the specified item from the cache or generate it.

Parameters

$key
$fallback

Returns

mixed
mixed
public array
# bulkLoad( array $keys, $fallback = null )

Reads multiple items from the cache.

Reads multiple items from the cache.

Parameters

$keys
$fallback
$fallback

Returns

array
array
public mixed
# save( mixed $key, mixed $data, array $dependencies = null )

Writes item into the cache. Dependencies are:

  • Cache::PRIORITY => (int) priority
  • Cache::EXPIRATION => (timestamp) expiration
  • Cache::SLIDING => (bool) use sliding expiration?
  • Cache::TAGS => (array) tags
  • Cache::FILES => (array|string) file names
  • Cache::ITEMS => (array|string) cache items
  • Cache::CONSTS => (array|string) cache items

Writes item into the cache. Dependencies are:

  • Cache::PRIORITY => (int) priority
  • Cache::EXPIRATION => (timestamp) expiration
  • Cache::SLIDING => (bool) use sliding expiration?
  • Cache::TAGS => (array) tags
  • Cache::FILES => (array|string) file names
  • Cache::ITEMS => (array|string) cache items
  • Cache::CONSTS => (array|string) cache items

Parameters

$key
$data
$dependencies

Returns

mixed
value itself
public
# remove( mixed $key )

Removes item from the cache.

Removes item from the cache.

Parameters

$key
public
# clean( array $conditions = null )

Removes items from the cache by conditions. Conditions are:

  • Cache::PRIORITY => (int) priority
  • Cache::TAGS => (array) tags
  • Cache::ALL => true

Removes items from the cache by conditions. Conditions are:

  • Cache::PRIORITY => (int) priority
  • Cache::TAGS => (array) tags
  • Cache::ALL => true
public mixed
# call( callable $function )

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function

Returns

mixed
mixed
public Closure
# wrap( callable $function, array $dependencies = null )

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function
$dependencies

Returns

Closure
\Closure
public Nette\Caching\OutputHelper|null
# start( mixed $key )

Starts the output cache.

Starts the output cache.

Parameters

$key

Returns

Nette\Caching\OutputHelper|null
OutputHelper|null
protected string
# generateKey( mixed $key )

Generates internal cache key.

Generates internal cache key.

Parameters

$key

Returns

string
string
public static boolean
# checkCallbacks( array $callbacks )

Checks CALLBACKS dependencies.

Checks CALLBACKS dependencies.

Returns

boolean
bool
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string PRIORITY

dependency

dependency

#'priority'
string EXPIRATION

dependency

dependency

#'expire'
string EXPIRE

dependency

dependency

#'expire'
string SLIDING

dependency

dependency

#'sliding'
string TAGS

dependency

dependency

#'tags'
string FILES

dependency

dependency

#'files'
string ITEMS

dependency

dependency

#'items'
string CONSTS

dependency

dependency

#'consts'
string CALLBACKS

dependency

dependency

#'callbacks'
string NAMESPACES

dependency

dependency

#'namespaces'
string ALL

dependency

dependency

#'all'
string NAMESPACE_SEPARATOR

Internal

#"\x00"
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0