1,20 → 1,21 |
<?php |
class CacheSqlite { |
/** |
* Available options |
* Options disponibles : |
* |
* =====> (string) cache_db_complete_path : |
* - the complete path (filename included) of the SQLITE database |
* ====> (string) stockage_chemin : |
* Chemin vers le fichier contenant la base SQLite. |
* |
* |
* ====> (int) automatic_vacuum_factor : |
* - Disable / Tune the automatic vacuum process |
* - The automatic vacuum process defragment the database file (and make it smaller) |
* when a clean() or delete() is called |
* 0 => no automatic vacuum |
* 1 => systematic vacuum (when delete() or clean() methods are called) |
* x (integer) > 1 => automatic vacuum randomly 1 times on x clean() or delete() |
* ====> (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 |
* |
* @var array Available options |
* @var array options disponibles |
*/ |
protected $options = array( |
'stockage_chemin' => null, |
47,6 → 48,7 |
public function __construct(array $options = array(), Cache $cache) { |
$this->Cache = $cache; |
if (extension_loaded('sqlite')) { |
$this->initialiserOptionsParConfig(); |
$this->setOptions($options); |
} else { |
$e = "Impossible d'utiliser le cache SQLITE car l'extenssion 'sqlite' n'est pas chargée dans l'environnement PHP courrant."; |
54,6 → 56,14 |
} |
} |
|
private function initialiserOptionsParConfig() { |
while (list($nom, $valeur) = each($this->options)) { |
if (Config::existe($nom)) { |
$this->options[$nom] = Config::get($nom); |
} |
} |
} |
|
/** |
* Destructor |
* |