[SPIP] +spip v3.0.17
[lhc/web/clavette_www.git] / www / plugins-dist / textwheel / inc / memoization-mini.php
diff --git a/www/plugins-dist/textwheel/inc/memoization-mini.php b/www/plugins-dist/textwheel/inc/memoization-mini.php
new file mode 100644 (file)
index 0000000..0b6852b
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+# memoization minimale (preferer le plugin memoization)
+function cache_get($key) {
+       return @unserialize(file_get_contents(_DIR_CACHE."wheels/".$key.".txt"));
+}
+function cache_set($key, $value) {
+       $dir = sous_repertoire(_DIR_CACHE,"wheels/");
+       return ecrire_fichier($dir.$key.".txt", serialize($value));
+}
+
+?>