Exemple #1
0
                if (count($cache_products) >= self::$cache_length) {
                    array_shift($cache_products);
                }
                $cache_products[] = $value_md5;
                if (!empty($cache_products)) {
                    set_transient('dln_cache_status', serialize($cache_products));
                }
                return true;
            }
        }
        private static function check_cache($value)
        {
            if (empty($value)) {
                return false;
            }
            $result = false;
            $cache_products = get_transient('dln_cache_status');
            $cache_products = !empty($cache_products) ? unserialize($cache_products) : null;
            if (!empty($cache_products)) {
                foreach ($cache_products as $i => $cache) {
                    if ($cache == $value) {
                        $result = true;
                        break;
                    }
                }
            }
            return $result;
        }
    }
    DLN_Block_Cache::get_instance();
}