previousconstructeur de Cache_Lite_File::
Cache_Lite_File
(Previous)
(Next) Configurationnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Cache_Lite_File::get

Cache_Lite_File::get() – Teste si un cache est disponible et (si oui), le retourne

Synopsis

require_once 'Cache/Lite/File.php';

string Cache_Lite_File::get ( string $id , string $group = 'default' )

Description

Teste la validité d'un fichier de cache et le retourne s'il est disponible (FALSE sinon).

Parameter

string $id

Identifiant de cache

string $group

Nom du groupe de cache

Return value

Retourne les données du cache (ou FALSE si aucun cache n'est disponible)

Note

This function can not be called statically.

Example

Utilisation

<?php
require_once "Cache/Lite/File.php";

$options = array(
    
'cacheDir' => '/tmp/',
    
'masterFile' => '/home/web/config.xml',
    
'pearErrorMode' => CACHE_LITE_ERROR_DIE
);
$cache = new Cache_Lite_File($options);

if (
$data $cache->get('id_of_the_page')) {

    
// Cache valide !
    // Contenu dans la variable $data
    // (...)

} else {

    
// Aucun cache valide de disponible (vous devez réaliser et sauvegarder la page)
    // (...)

}

?>
previousconstructeur de Cache_Lite_File::
Cache_Lite_File
(Previous)
(Next) Configurationnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.