Overview

Packages

  • Framework
  • None
  • PHP
  • Utilitaire

Classes

  • CacheFichier
  • CacheSqlite
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class CacheSqlite

Located at CacheSqlite.php
Methods summary
public
# __construct( array $options = array(), Cache $cache )

Constructor

Constructor

Parameters

$options
array
$options Associative array of options
$cache

Throws

Zend_cache_Exception
public
# __destruct( )

Destructor

Destructor

public
# setEmplacement( mixed $emplacement )
public string|false
# charger( string $id, boolean $ne_pas_tester_validiter_du_cache = false )

Test if a cache is available for the given id and (if yes) return it (false else)

Test if a cache is available for the given id and (if yes) return it (false else)

Parameters

$id
string
$id Cache id
$ne_pas_tester_validiter_du_cache
boolean
$doNotTestCacheValidity If set to true, the cache validity won't be tested

Returns

string|false
Cached datas
public mixed|false
# tester( string $id )

Test if a cache is available or not (for the given id)

Test if a cache is available or not (for the given id)

Parameters

$id
string
$id Cache id

Returns

mixed|false
(a cache is not available) or "last modified" timestamp (int) of the available cache record
public boolean
# sauver( string $donnees, string $id, array $tags = array(), integer $duree_vie_specifique = false )

Save some string datas into a cache record

Save some string datas into a cache record

Note : $data is always "string" (serialization is done by the core not by the backend)

Parameters

$donnees
string
$data Datas to cache
$id
string
$id Cache id
$tags
array
$tags Array of strings, the cache record will be tagged by each string entry
$duree_vie_specifique
integer
$specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)

Returns

boolean
True if no problem

Throws

Zend_Cache_Exception
public boolean
# supprimer( string $id )

Remove a cache record

Remove a cache record

Parameters

$id
string
$id Cache id

Returns

boolean
True if no problem
public boolean
# nettoyer( string $mode = Cache::NETTOYAGE_MODE_TOUS, array $tags = array() )

Clean some cache records

Clean some cache records

Available modes are : Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags ($tags can be an array of strings or a single string)

Parameters

$mode
string
$mode Clean mode
$tags
array
$tags Array of tags

Returns

boolean
True if no problem
public array
# getIds( )

Return an array of stored cache ids

Return an array of stored cache ids

Returns

array
array of stored cache ids (string)
public array
# getTags( )

Return an array of stored tags

Return an array of stored tags

Returns

array
array of stored tags (string)
public array
# getIdsAvecLesTags( array $tags = array() )

Return an array of stored cache ids which match given tags

Return an array of stored cache ids which match given tags

In case of multiple tags, a logical AND is made between tags

Parameters

$tags
array
$tags array of tags

Returns

array
array of matching cache ids (string)
public array
# getIdsSansLesTags( array $tags = array() )

Return an array of stored cache ids which don't match given tags

Return an array of stored cache ids which don't match given tags

In case of multiple tags, a logical OR is made between tags

Parameters

$tags
array
$tags array of tags

Returns

array
array of not matching cache ids (string)
public array
# getIdsAvecUnTag( array $tags = array() )

Return an array of stored cache ids which match any given tags

Return an array of stored cache ids which match any given tags

In case of multiple tags, a logical AND is made between tags

Parameters

$tags
array
$tags array of tags

Returns

array
array of any matching cache ids (string)
public integer
# getPourcentageRemplissage( )

Return the filling percentage of the backend storage

Return the filling percentage of the backend storage

Returns

integer
integer between 0 and 100

Throws

Zend_Cache_Exception
public array
# getMetadonnees( string $id )

Return an array of metadatas for the given cache id

Return an array of metadatas for the given cache id

The array must include these keys :

  • expire : the expire timestamp
  • tags : a string array of tags
  • mtime : timestamp of last modification time

Parameters

$id
string
$id cache id

Returns

array
array of metadatas (false if the cache id is not found)
public boolean
# ajouterSupplementDureeDeVie( string $id, integer $supplement_duree_de_vie )

Give (if possible) an extra lifetime to the given cache id

Give (if possible) an extra lifetime to the given cache id

Parameters

$id
string
$id cache id
$supplement_duree_de_vie
integer
$extraLifetime

Returns

boolean
true if ok
Properties summary
protected array $options array( 'stockage_chemin' => null, 'defragmentation_auto' => 10 )
#

Options disponibles :

Options disponibles :

> (string) stockage_chemin :

Chemin vers le fichier contenant la base SQLite.

> (int) defragmentation_auto :

  • Désactive / Régler le processus de défragmentation automatique
  • Le processus de défragmentation automatiques réduit la taille du fichier contenant la base de données quand un ajout ou une suppression de cache est réalisée : 0 => pas de défragmentation automatique 1 => défragmentation automatique systématique x (integer) > 1 => défragmentation automatique toutes les 1 fois (au hasard) sur x ajout ou suppression de cache
TBFramework - v0.3 API documentation generated by ApiGen 2.8.0