public static function &loader($ruleset, $callback = '', $class = 'SPIPTextWheelRuleset', $file_cache = '') { # memoization $key = 'tw-' . md5(serialize($ruleset) . $callback . $class); # lecture du cache include_spip('inc/memoization'); if (!_request('var_mode') and $cacheruleset = cache_get($key)) { return $cacheruleset; } # calcul de la wheel $ruleset = parent::loader($ruleset, $callback, $class); # ecriture du cache cache_set($key, $ruleset); return $ruleset; }
public static function &loader($ruleset, $callback = '', $class = 'SPIPTextWheelRuleset') { # memoization # attention : le ruleset peut contenir apres loading des chemins relatifs # il faut donc que le cache depende du chemin courant vers la racine de SPIP $key = 'tw-' . md5(_WHEELS_VERSION . "-" . serialize($ruleset) . $callback . $class . _DIR_RACINE); # lecture du cache include_spip('inc/memoization'); if (!function_exists('cache_get')) { include_spip('inc/memoization-mini'); } if ((!defined('_VAR_MODE') or _VAR_MODE != 'recalcul') and $cacheruleset = cache_get($key)) { return $cacheruleset; } # calcul de la wheel $ruleset = parent::loader($ruleset, $callback, $class); # ecriture du cache cache_set($key, $ruleset); return $ruleset; }