[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/cache/ -> MapCacheLRU.php (summary)

Per-process memory cache for storing items. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 123 lines (3 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

MapCacheLRU:: (6 methods):
  __construct()
  set()
  has()
  get()
  clear()
  ping()


Class: MapCacheLRU  - X-Ref

Handles a simple LRU key/value map with a maximum number of entries

Use ProcessCacheLRU if hierarchical purging is needed or objects can become stale

__construct( $maxKeys )   X-Ref

param: int $maxKeys Maximum number of entries allowed (min 1).

set( $key, $value )   X-Ref
Set a key/value pair.
This will prune the cache if it gets too large based on LRU.
If the item is already set, it will be pushed to the top of the cache.

param: string $key
param: mixed $value
return: void

has( $key )   X-Ref
Check if a key exists

param: string $key
return: bool

get( $key )   X-Ref
Get the value for a key.
This returns null if the key is not set.
If the item is already set, it will be pushed to the top of the cache.

param: string $key
return: mixed

clear( $keys = null )   X-Ref
Clear one or several cache entries, or all cache entries

param: string|array $keys
return: void

ping( $key )   X-Ref
Push an entry to the top of the cache

param: string $key



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1