Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NCache
  • NDummyStorage
  • NFileStorage
  • NMemcachedStorage

Interfaces

  • ICacheStorage
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NCache

Implements the cache for a application.

NObject
Extended by NCache implements ArrayAccess
Package: Nette\Caching
Author: David Grudl
Located at Caching/Cache.php
Methods summary
public
# __construct( ICacheStorage $storage, $namespace = NULL )
public ICacheStorage
# getStorage( )

Returns cache storage.

Returns cache storage.

Returns

ICacheStorage
public string
# getNamespace( )

Returns cache namespace.

Returns cache namespace.

Returns

string
public
# release( )

Discards the internal cache.

Discards the internal cache.

public mixed
# save( string $key, mixed $data, array $dp = NULL )

Writes item into the cache. Dependencies are:

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

Writes item into the cache. Dependencies are:

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

Parameters

$key
string
key
$data
mixed
value
$dp
array
dependencies

Returns

mixed
value itself

Throws

InvalidArgumentException
public
# clean( array $conds = NULL )

Removes items from the cache by conditions. Conditions are:

  • NCache::PRIORITY => (int) priority
  • NCache::TAGS => (array) tags
  • NCache::ALL => TRUE

Removes items from the cache by conditions. Conditions are:

  • NCache::PRIORITY => (int) priority
  • NCache::TAGS => (array) tags
  • NCache::ALL => TRUE

Parameters

$conds
array
public
# offsetSet( string $key, mixed $data )

Inserts (replaces) item into the cache (ArrayAccess implementation).

Inserts (replaces) item into the cache (ArrayAccess implementation).

Parameters

$key
string
key
$data
mixed

Throws

InvalidArgumentException

Implementation of

ArrayAccess::offsetSet
public mixed|null
# offsetGet( string $key )

Retrieves the specified item from the cache or NULL if the key is not found (ArrayAccess implementation).

Retrieves the specified item from the cache or NULL if the key is not found (ArrayAccess implementation).

Parameters

$key
string
key

Returns

mixed|null

Throws

InvalidArgumentException

Implementation of

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

Exists item in cache? (ArrayAccess implementation).

Exists item in cache? (ArrayAccess implementation).

Parameters

$key
string
key

Returns

boolean

Throws

InvalidArgumentException

Implementation of

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

Removes the specified item from the cache.

Removes the specified item from the cache.

Parameters

$key
string
key

Throws

InvalidArgumentException

Implementation of

ArrayAccess::offsetUnset
public static boolean
# checkCallbacks( array $callbacks )

Checks CALLBACKS dependencies.

Checks CALLBACKS dependencies.

Parameters

$callbacks
array

Returns

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

dependency

dependency

string EXPIRATION 'expire'
#
string EXPIRE 'expire'
#
string SLIDING 'sliding'
#
string TAGS 'tags'
#
string FILES 'files'
#
string ITEMS 'items'
#
string CONSTS 'consts'
#
string CALLBACKS 'callbacks'
#
string ALL 'all'
#
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0