Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • Cache
  • OutputHelper

Interfaces

  • IStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Cache

Implements the cache for a application.

Nette\Object
Extended by Nette\Caching\Cache implements ArrayAccess
Namespace: Nette\Caching
Author: David Grudl
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
public string
# getNamespace( )

Returns cache namespace.

Returns cache namespace.

Returns

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

Returns new nested cache object.

Returns new nested cache object.

Parameters

$namespace
string

Returns

Nette\Caching\Cache
public mixed|null
# 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
mixed
key
$fallback
callable

Returns

mixed|null
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
mixed
key
$data
mixed
value
$dependencies
array
dependencies

Returns

mixed
value itself

Throws

Nette\InvalidArgumentException
public
# remove( mixed $key )

Removes item from the cache.

Removes item from the cache.

Parameters

$key
mixed
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( mixed $function )

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function
mixed

Returns

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

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function
mixed
$dependencies
array
dependencies

Returns

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

Starts the output cache.

Starts the output cache.

Parameters

$key
mixed
key

Returns

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

Generates internal cache key.

Generates internal cache key.

Parameters

$key
string

Returns

string
public
# offsetSet( $key, $data )

Deprecated

Implementation of

ArrayAccess::offsetSet()
public
# offsetGet( $key )

Deprecated

Implementation of

ArrayAccess::offsetGet()
public
# offsetExists( $key )

Deprecated

Implementation of

ArrayAccess::offsetExists()
public
# offsetUnset( $key )

Deprecated

Implementation of

ArrayAccess::offsetUnset()
public
# release( )

Deprecated

public static boolean
# checkCallbacks( array $callbacks )

Checks CALLBACKS dependencies.

Checks CALLBACKS dependencies.

Parameters

$callbacks
array

Returns

boolean
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string PRIORITY 'priority'
#

dependency

dependency

string EXPIRATION 'expire'
#

dependency

dependency

string EXPIRE 'expire'
#

dependency

dependency

string SLIDING 'sliding'
#

dependency

dependency

string TAGS 'tags'
#

dependency

dependency

string FILES 'files'
#

dependency

dependency

string ITEMS 'items'
#

dependency

dependency

string CONSTS 'consts'
#

dependency

dependency

string CALLBACKS 'callbacks'
#

dependency

dependency

string ALL 'all'
#

dependency

dependency

Magic properties inherited from Nette\Object
$reflection
Nette 2.2 API documentation generated by ApiGen 2.8.0