remove() public method

Remove a cache file
public remove ( string $id, string $group = 'default' ) : boolean
$id string cache id
$group string name of the cache group
return boolean true if no problem
Exemplo n.º 1
0
 /**
  * This is a warpper for Cache_Lite::remove(), since it generates
  * strict warnings.
  * 
  * @param mixed $key The key to remove from cache
  * 
  * @return result of Cache_Lite::remove(), without the strict warnings
  */
 protected function removeFromCache($key)
 {
     $current = error_reporting();
     error_reporting($current & ~E_STRICT);
     $this->cache->remove($key);
     error_reporting($current);
 }
 /**
  * Remove a cached data entry by ID and group
  *
  * @param   string  $id     The cache data ID
  * @param   string  $group  The cache data group
  *
  * @return  boolean
  *
  * @since   11.1
  */
 public function remove($id, $group)
 {
     static::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/');
     // This call is needed to ensure $this->rawname is set
     $this->_getCacheId($id, $group);
     return static::$CacheLiteInstance->remove($this->rawname, $group);
 }
Exemplo n.º 3
0
 public function intercept_page(&$page)
 {
     if ($this->_in_excluded_pages()) {
         return;
     }
     $frontend = Frontend::instance();
     $logged_in = $frontend->isLoggedIn();
     $headers = $page['page']->_headers;
     $url = getCurrentPage();
     $options = array('cacheDir' => CACHE . "/", 'lifeTime' => $this->_get_lifetime());
     $cl = new Cache_Lite($options);
     if ($page['page']->_param['url-flush'] == 'site') {
         $cl->clean();
     } else {
         if (array_key_exists('url-flush', $page['page']->_param)) {
             $cl->remove($url);
         } else {
             if (!$logged_in && ($output = $cl->get($url))) {
                 # Ensure the original headers are served out
                 foreach ($headers as $header) {
                     header($header);
                 }
                 print $output;
                 if ($this->_get_comment_pref() == 'yes') {
                     echo "<!-- Cache served: " . $cl->_fileName . " -->";
                 }
                 exit;
             }
         }
     }
 }
Exemplo n.º 4
0
 public function delete()
 {
     global $config;
     if ($config['cache']['disable']) {
         return false;
     }
     return parent::remove($this->cache_id, $this->cache_group);
 }
Exemplo n.º 5
0
 /**
  * Removes all items from cache with specified cache ids (cache id = md5(id))
  *
  * @param	array	$ids
  * @return	bool
  */
 public function delete_by_cache_id(array $ids)
 {
     if (empty($ids)) {
         return true;
     }
     foreach ($ids as $id) {
         if ($this->cache_lite->remove($id, 'vivvo_cache') !== true) {
             return false;
         }
     }
     return true;
 }
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
if ($this->get['invoices_export_hash']) {
    set_time_limit(86400);
    ignore_user_abort(true);
    $invoices_export = mslib_fe::getInvoicesExportWizard($this->get['invoices_export_hash'], 'code');
    $lifetime = 7200;
    if ($this->ADMIN_USER) {
        $lifetime = 0;
    }
    $options = array('caching' => true, 'cacheDir' => $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/cache/', 'lifeTime' => $lifetime);
    $Cache_Lite = new Cache_Lite($options);
    $string = 'invoicesfeed_' . $this->shop_pid . '_' . serialize($invoices_export) . '-' . md5($this->cObj->data['uid'] . '_' . $this->server['REQUEST_URI'] . $this->server['QUERY_STRING']);
    if ($this->ADMIN_USER and $this->get['clear_cache']) {
        $Cache_Lite->remove($string);
    }
    if (!($content = $Cache_Lite->get($string))) {
        $fields = unserialize($invoices_export['fields']);
        $post_data = unserialize($invoices_export['post_data']);
        if (!$post_data['delimeter_type']) {
            $post_data['delimeter_type'] = ';';
        }
        $fields_values = $post_data['fields_values'];
        $records = array();
        // orders record
        $filter = array();
        $from = array();
        $having = array();
        $match = array();
        $orderby = array();
 /**
  * Explicitly deletes (empties) values stored for the given key
  * @param string $key The key used to delete value
  * @return boolean
  */
 public function delete($key)
 {
     return $this->cache->remove($key, self::$group);
 }
Exemplo n.º 8
0
 public function getFromCache($id, $group, $REQUIRED_KEYS = null, $sign = null)
 {
     $cacheId = $this->localCacheKey($id, $group);
     //Сначала ищем в локальном хранилище
     if ($this->CACHE->has($cacheId)) {
         $CACHED = $this->CACHE->get($cacheId);
         if ($CACHED['sign'] == $sign) {
             $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в локальном кеше");
             return $CACHED['data'];
         } else {
             $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в локальном кеше, но старая и новая подписи не совпадают: [{}]!=[{}]. Чистим...", $CACHED['sign'], $sign);
             $this->CACHE->remove($cacheId);
             $this->CACHELITE->remove($id, $group);
             return null;
         }
     }
     /*
      * Самое интересное и спорное место всей реализации.
      * Нам нужно отслеживать свежесть кешей. Сами по себе они сбрасываются через опередённое время (время жизни кеша).
      * Но это время достаточно велико и, если мы сейчас, например, правим код, то нам некогда ждать, пока всё само сабой обновится.
      * 
      * Кеши валидируются через свои, so called, "подписи".
      * Например - структура проекта (строка навигации) зависит от кол-ва постов в каждом разделе, но при этом если какой-либо пост изменится, то
      * на подпись кеша для навигации это никак не повлияет, а ведь в посте мог измениться анонс, например.
      * 
      * Всё крутится вокруг изменения сущностей фолдингов. При изменении сущности будет сброшен кеш, который от этого фолдинга зависит.
      * Весь вопрос в том - как отслеживать эти изменения?.. Единственное решение - пробегать по всем фолдингам и выполнять checkAllEntityChanged.
      * Решение это довольно дорогостоящее. Даже если сущность не изменилась и кеш не будет перестроен, мы вынуждены выполнить очень много действий.
      * 
      * Есть два варинта для обеспечения "свежести" кешей:
      * 
      * Вариант №1.
      * Каждый раз при запросе кеша выполнять checkAllEntityChanged для фолдингов, от которых зависит запрашеваемая группа кешей.
      * Это нам ВСЕГДА обеспечит свежесть всех кешей, но данная операция является довольно тяжёлой.
      * 
      * Вариант №2.
      * Выполнять проверку checkAllEntityChanged для всех фолдингов, но так как это довольно дорого - делать это не каждый раз, а с определённой периодичностью.
      * Это также обеспечивает свежесть кешей, но операция - очень тяжёлая, поэтому её нельзя выполнять каждый раз.
      * В идеале её вообще должен выполнять внешний процесс, запускаемый раз в EXTERNAL_PROCESS_CALL_DELAY минут.
      * Будем эмулировать его работу посредством класса ExternalProcess.
      * В продакшене будет работать второй вариант - там частота обновлений кешей не так важна.
      */
     $this->validateGroup($group);
     PsProfiler::inst(__CLASS__)->start('LOAD from cache');
     $CACHED = $this->CACHELITE->get($id, $group);
     PsProfiler::inst(__CLASS__)->stop();
     if (!$CACHED) {
         $this->LOGGER->info("Информация по ключу '{$cacheId}' не найдена в кеше");
         return null;
     }
     if (!is_array($CACHED)) {
         $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в хранилище, но не является массивом. Чистим...");
         $this->CACHELITE->remove($id, $group);
         return null;
     }
     if (!array_has_all_keys(array('data', 'sign'), $CACHED)) {
         $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в хранилище, но отсутствует параметр sign или data. Чистим...");
         $this->CACHELITE->remove($id, $group);
         return null;
     }
     if ($CACHED['sign'] != $sign) {
         $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в хранилище, но старая и новая подписи не совпадают: [{}]!=[{}]. Чистим...", $CACHED['sign'], $sign);
         $this->CACHELITE->remove($id, $group);
         return null;
     }
     $MUST_BE_ARRAY = is_array($REQUIRED_KEYS);
     $REQUIRED_KEYS = to_array($REQUIRED_KEYS);
     if ($MUST_BE_ARRAY || !empty($REQUIRED_KEYS)) {
         //Если нам переданы ключи для проверки, значит необходимо убедиться, что сами данные являются массивом
         if (!is_array($CACHED['data'])) {
             $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в хранилище, но не является массивом. Чистим...");
             $this->CACHELITE->remove($id, $group);
             return null;
         }
         foreach ($REQUIRED_KEYS as $key) {
             if (!array_key_exists($key, $CACHED['data'])) {
                 $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена, но в данных отсутствует обязательный ключ [{$key}]. Чистим...");
                 $this->CACHELITE->remove($id, $group);
                 return null;
             }
         }
     }
     $this->LOGGER->info("Информация по ключу '{$cacheId}' найдена в хранилище");
     //Перенесём данные в локальный кеш для быстрого доступа
     return array_get_value('data', $this->CACHE->set($cacheId, $CACHED));
 }
 function cleanup()
 {
     $cache = $this->get_config('cache');
     if ($this->get_config('cache') == 'no') {
         if (@(include_once "Cache/Lite.php")) {
             $cache_obj = new Cache_Lite(array('cacheDir' => $serendipity['serendipityPath'] . 'templates_c/', 'automaticSerialization' => true));
             @$cache_obj->remove('linklist_html');
             @$cache_obj->remove('linklist_xmlhash');
         }
     }
     $setdata = array('display' => $this->get_config('display'), 'category' => $this->get_config('category'), 'style' => $this->get_config('style'), 'cache' => $cache);
     if ($this->get_config('directxml') != 'true') {
         $blah = $this->get_config('display');
         if (!isset($blah)) {
             $this->set_config('display', 'category');
         }
         $setdata['enabled'] = 'true';
         $setdata['links'] = $this->get_config('links');
     } else {
         $setdata['enabled'] = 'false';
     }
     serendipity_plugin_api::hook_event('plugins_linklist_conf', $setdata);
     if ($setdata['changed'] == 'true') {
         $this->set_config('links', $setdata['links']);
     }
 }
Exemplo n.º 10
0
 /**
  * A method to remove a cache file
  *
  * @param string $cacheName The name of the original file
  * @return bool True if the cache was deleted
  */
 function remove($cacheName)
 {
     $id = $this->_getId($cacheName);
     $group = $this->_getGroup($cacheName);
     return $this->oCache->remove($id, $group);
 }
Exemplo n.º 11
0
 public function removeFromCache($id, $group)
 {
     $this->IMPL->remove($id, $group);
 }
Exemplo n.º 12
0
 function clear()
 {
     return $this->oCache->remove($this->id, $this->group);
 }
Exemplo n.º 13
0
 function removeCache()
 {
     $this->oCache->remove($this->cacheId, $this->groupId);
 }
Exemplo n.º 14
0
<?php

//Guardar IMG
session_start();
$username = $_SESSION['username'];
require "config.php";
$filefile = $_FILES['foto']['name'];
$urrl = "local_img/" . $filefile;
$time = time();
$id = $_GET['id'];
//Borra la cache de las fotos:
require_once "cachelite/Lite.php";
$options = array("cacheDir" => "cachelite/", "lifeTime" => 0);
$objCache = new Cache_Lite($options);
$objCache->remove("last_img");
//
if ($urrl != "local_img/") {
    $ran = rand(1, 999999);
    $urrl = "local_img/" . $ran . $filefile;
}
//echo($filefile.$urrl);
echo "Guardando...";
if (is_uploaded_file($_FILES['foto']['tmp_name'])) {
    //copy($HTTP_POST_FILES['filename']['foto'], $HTTP_POST_FILES['filename']['tmp_name']);
    copy($_FILES['foto']['tmp_name'], $urrl);
    $subio = true;
}
mysql_query("INSERT INTO  `markers_foto` (\n`id` ,\n`local_id` ,\n`image` ,\n`username` ,\n`timestamp`\n)\nVALUES (\nNULL ,  '" . $id . "',  '" . $urrl . "',  '" . $username . "',  '" . $time . "'\n);");
$ver_todoo = mysql_query("SELECT * FROM markers WHERE id = '{$id}' ;");
while ($prodroww = mysql_fetch_array($ver_todoo)) {
    $iddd = $prodroww['id'];
Exemplo n.º 15
0
         }
     }
     mb_convert_variables('CP932', 'UTF-8', $search_result);
     $cache->save($search_result, $cache_id_result, $cache_group_result);
 }
 // 検索結果キャッシュのガーベッジコレクション
 if (mt_rand(0, 99) == 0) {
     P2Util::garbageCollection($cache_options['cacheDir'], $cache_options['lifeTime'], 'cache_' . $cache_group_result);
     P2Util::garbageCollection($cache_options['cacheDir'], $cache_options['lifeTime'], 'cache_' . $cache_group_profile);
 }
 $errors = isset($search_result['errors']) ? $search_result['errors'] : null;
 $threads = isset($search_result['threads']) ? $search_result['threads'] : null;
 $profile = $search_profile['profile'];
 $modified = strtotime($search_profile['modified']);
 if ($errors) {
     $cache->remove($cache_id_result, $cache_group_result);
     $cache->remove($cache_id_profile, $cache_group_profile);
 } else {
     // 検索履歴を更新
     if ($_conf['expack.tgrep.recent_num'] > 0) {
         FileCtl::make_datafile($_conf['expack.tgrep.recent_file'], $_conf['expack.tgrep.file_perm']);
         $tgrep_recent_list = FileCtl::file_read_lines($_conf['expack.tgrep.recent_file'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
         if (!is_array($tgrep_recent_list)) {
             $tgrep_recent_list = array();
         }
         array_unshift($tgrep_recent_list, preg_replace('/[\\r\\n\\t]/', ' ', trim($_GET['Q'])));
         $tgrep_recent_list = array_unique($tgrep_recent_list);
         while (count($tgrep_recent_list) > $_conf['expack.tgrep.recent_num']) {
             array_pop($tgrep_recent_list);
         }
         $tgrep_recent_data = implode("\n", $tgrep_recent_list) . "\n";
 function event_hook($event, &$bag, &$eventData, $addData = null)
 {
     global $serendipity;
     $hooks =& $bag->get('event_hooks');
     if (isset($hooks[$event])) {
         switch ($event) {
             case 'backend_sidebar_entries_event_display_linklist':
                 if ($this->get_config('active') != 'true') {
                     return false;
                 }
                 if (isset($_POST['REMOVE'])) {
                     if (isset($_POST['serendipity']['link_to_remove'])) {
                         foreach ($_POST['serendipity']['link_to_remove'] as $key) {
                             $this->del_link($key);
                         }
                     } else {
                         if (isset($_POST['serendipity']['category_to_remove'])) {
                             foreach ($_POST['serendipity']['category_to_remove'] as $key) {
                                 $this->del_category($key);
                             }
                         }
                     }
                 }
                 if (isset($_POST['SAVE'])) {
                     foreach ($_POST['serendipity']['link_to_recat'] as $key => $row) {
                         $this->update_cat($key, $row);
                     }
                 }
                 if (isset($_POST['ADD'])) {
                     if (isset($_POST['serendipity']['add_link']['title']) && isset($_POST['serendipity']['add_link']['link'])) {
                         $this->add_link($_POST['serendipity']['add_link']['link'], $_POST['serendipity']['add_link']['title'], $_POST['serendipity']['add_link']['desc'], $_POST['serendipity']['link_to_recat']['cat']);
                     } else {
                         if (isset($_POST['serendipity']['add_category']['title'])) {
                             $this->add_cat($_POST['serendipity']['add_category']['title'], $_POST['serendipity']['link_to_recat']['cat']);
                         }
                     }
                 }
                 if (isset($_POST['EDIT'])) {
                     if (isset($_POST['serendipity']['add_link']['title']) && isset($_POST['serendipity']['add_link']['link']) && isset($_POST['serendipity']['add_link']['id'])) {
                         $this->update_link($_POST['serendipity']['add_link']['id'], $_POST['serendipity']['add_link']['link'], $_POST['serendipity']['add_link']['title'], $_POST['serendipity']['add_link']['desc'], $_POST['serendipity']['link_to_recat']['cat']);
                     }
                 }
                 switch ($_GET['submit']) {
                     case 'move up':
                         $this->move_up($_GET['serendipity']['link_to_move']);
                         break;
                     case 'move down':
                         $this->move_down($_GET['serendipity']['link_to_move']);
                         break;
                 }
                 if ($this->get_config('cache') == 'yes') {
                     if (@(include_once "Cache/Lite.php")) {
                         $cache_obj = new Cache_Lite(array('cacheDir' => $serendipity['serendipityPath'] . 'templates_c/', 'automaticSerialization' => true));
                         $output = $this->generate_output(true);
                         $cache_obj->save($output, 'linklist_cache');
                     } else {
                         $output = $this->generate_output(true);
                         $this->set_config('cached_output', $output);
                     }
                 }
                 if (isset($_GET['serendipity']['edit_link'])) {
                     $this->output_add_edit_linkadmin(TRUE, $_GET['serendipity']['edit_link']);
                 } else {
                     if (isset($_GET['serendipity']['manage_category'])) {
                         $this->output_categoryadmin(TRUE, $_GET['serendipity']['edit_link']);
                     } else {
                         $this->output_add_edit_linkadmin(FALSE);
                         $this->output_linkadmin();
                     }
                 }
                 return true;
                 break;
             case 'backend_sidebar_entries':
                 if ($this->get_config('active') == 'true' && $serendipity['version'][0] < 2) {
                     echo "\n" . '<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">' . PLUGIN_LINKLIST_ADMINLINK . '</a></li>';
                 }
                 return true;
                 break;
             case 'backend_sidebar_admin_appearance':
                 if ($this->get_config('active') == 'true' && $serendipity['version'][0] > 1) {
                     echo "\n" . '<li><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">' . PLUGIN_LINKLIST_ADMINLINK . '</a></li>';
                 }
                 return true;
                 break;
             case 'css':
                 if ($this->get_config('style') == 'dtree') {
                     $searchstr = '.dtree';
                     $filename = 'serendipity_event_dtree.css';
                 } else {
                     $searchstr = '.linklist';
                     $filename = 'serendipity_event_linklist.css';
                 }
                 // class exists in CSS by another Plugin, or a User has customized it and we don't need default
                 $pos = strpos($eventData, $searchstr);
                 if ($pos === false) {
                     $tfile = serendipity_getTemplateFile($filename, 'serendipityPath');
                     if (!$tfile || $tfile == $filename) {
                         $tfile = dirname(__FILE__) . '/' . $filename;
                     }
                     $eventData .= file_get_contents($tfile);
                 }
                 return true;
                 break;
             case 'external_plugin':
                 $uri_parts = explode('?', str_replace('&amp;', '&', $eventData));
                 $parts = explode('&', $uri_parts[0]);
                 $uri_part = $parts[0];
                 switch ($uri_part) {
                     case 'lldtree.js':
                         // name unique!
                         header('Content-Type: text/javascript');
                         echo file_get_contents(dirname(__FILE__) . '/dtree.js');
                         break;
                     case 'linklist.js':
                         header('Content-Type: text/javascript');
                         echo file_get_contents(dirname(__FILE__) . '/linklist.js');
                         break;
                 }
                 return true;
                 break;
             case 'plugins_linklist_input':
                 $eventData['links'] = $this->generate_output(false);
                 return true;
                 break;
             case 'plugins_linklist_conf':
                 $this->set_config('style', $eventData['style']);
                 $this->set_config('display', $eventData['display']);
                 $this->set_config('category', $eventData['category']);
                 $this->set_config('cache', $eventData['cache']);
                 $eventData['changed'] = 'false';
                 if ($eventData['enabled'] == 'true') {
                     if ($this->get_config('active') != 'true') {
                         $eventData['changed'] = 'true';
                         $this->set_config('active', 'true');
                         $this->set_config('active', 'true');
                         $this->set_config('category', 'custom');
                         $q = 'SELECT count(id) FROM ' . $serendipity['dbPrefix'] . 'links';
                         $sql = serendipity_db_query($q);
                         if ($sql[0][0] == 0) {
                             $xml = xml_parser_create('UTF-8');
                             xml_parse_into_struct($xml, '<list>' . serendipity_utf8_encode($eventData['links']) . '</list>', $struct, $index);
                             xml_parser_free($xml);
                             $depth = -1;
                             for ($level[] = 0, $i = 1, $j = 1; isset($struct[$i]); $i++, $j++) {
                                 if (isset($struct[$i]['type'])) {
                                     if ($struct[$i]['type'] == 'open' && strtolower($struct[$i]['tag']) == 'dir') {
                                         $this->add_cat($this->decode($struct[$i]['attributes']['NAME']), $in_cat[0]);
                                         $q = 'SELECT categoryid FROM ' . $serendipity['dbPrefix'] . 'link_category where category_name = "' . serendipity_db_escape_string($this->decode($struct[$i]['attributes']['NAME'])) . '"';
                                         $sql = serendipity_db_query($q);
                                         $in_cat[] = $sql[0][0];
                                         $depth++;
                                     } else {
                                         if ($struct[$i]['type'] == 'close' && strtolower($struct[$i]['tag']) == 'dir') {
                                             $blah = array_pop($in_cat);
                                             $depth--;
                                         } else {
                                             if ($struct[$i]['type'] == 'complete' && strtolower($struct[$i]['tag']) == 'link') {
                                                 $this->add_link($this->decode($struct[$i]['attributes']['LINK']), $this->decode($struct[$i]['attributes']['NAME']), $this->decode($struct[$i]['attributes']['DESCRIP']), $in_cat[$depth]);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         if ($eventData['cache'] == 'yes') {
                             if (@(include_once "Cache/Lite.php")) {
                                 $cache_obj = new Cache_Lite(array('cacheDir' => $serendipity['serendipityPath'] . 'templates_c/', 'automaticSerialization' => true));
                                 $output = $this->generate_output(true);
                                 $eventData['links'] = $output;
                                 $cache_obj->save($output, 'linklist_cache');
                             } else {
                                 $output = $this->generate_output(true);
                                 $eventData['links'] = $output;
                                 $this->set_config('cached_output', $output);
                             }
                         }
                     }
                 } else {
                     if ($this->get_config('active') == 'true') {
                         $this->set_config('active', 'false');
                         $this->set_config('cache', 'no');
                         $this->set_config('display', 'category');
                         $eventData['links'] = $this->generate_output(true);
                         if (@(include_once "Cache/Lite.php")) {
                             $cache_obj = new Cache_Lite(array('cacheDir' => $serendipity['serendipityPath'] . 'templates_c/', 'automaticSerialization' => true));
                             @$cache_obj->remove('linklist_cache');
                         } else {
                             $this->set_config('cached_output', '');
                         }
                         $eventData['changed'] = 'true';
                     }
                 }
                 return true;
                 break;
             default:
                 return false;
                 break;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 17
0
 public function cacheLite($action = '', $key = '', $timeout = '', $serialized = 0, $content = '')
 {
     if ($action == 'delete_all') {
         if ($this->DOCUMENT_ROOT and !strstr($this->DOCUMENT_ROOT, '..') && is_dir($this->DOCUMENT_ROOT . "uploads/tx_multishop/tmp/cache")) {
             $command = "rm -rf " . $this->DOCUMENT_ROOT . "uploads/tx_multishop/tmp/cache/*";
             exec($command);
         }
     } else {
         if (!class_exists('Cache_Lite')) {
             require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'res/Cache_Lite-1.7.16/Cache/Lite.php';
         }
         $options = array('caching' => true, 'cacheDir' => $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/cache/', 'lifeTime' => $timeout);
         $Cache_Lite = new Cache_Lite($options);
         //$Cache_Lite =  \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Cache_Lite');
         $string = md5($key);
         switch ($action) {
             case 'get':
                 // get cache
                 $content = $Cache_Lite->get($string);
                 if ($serialized) {
                     $content = unserialize($content);
                 }
                 return $content;
                 break;
             case 'save':
                 // save cache
                 if ($serialized) {
                     $content = serialize($content);
                 }
                 $Cache_Lite->save($content, $string);
                 break;
             case 'delete':
                 // removes the cache
                 $Cache_Lite->remove($string);
                 break;
         }
     }
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['cacheLitePostProc'])) {
         $params = array('action' => $action);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['cacheLitePostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
 }
Exemplo n.º 18
0
 function removeTreeAsSelect()
 {
     $cache = new Cache_Lite(array('cacheDir' => CACHE_DIR . '/ntercache/', 'lifeTime' => 3600 * 24 * 7));
     return $cache->remove('treeasselect', 'default');
 }
Exemplo n.º 19
0
 function remove($id, $group = 'default')
 {
     parent::remove($id, $group);
     if (file_exists($this->_file . '_time')) {
         unlink($this->_file . '_time');
     }
 }
        $iErrors_counted += count($aErrors[$sKey]);
    }
    $tpl->set('s', 'ERRORS_COUNT_CHECKED', $iErrors_count_checked);
    $tpl->set('s', 'ERRORS_COUNT_ERRORS', $iErrors_counted);
    $tpl->set('s', 'ERRORS_COUNT_ERRORS_PERCENT', round($iErrors_counted * 100 / $iErrors_count_checked, 2));
    /* Template output */
    foreach ($aError_output as $sKey => $sValue) {
        if (empty($aError_output[$sKey])) {
            // Errors for this type?
            $tpl2->set('s', 'ERRORS_NOTHING', i18n("No errors for this type.", $plugin_name));
            $aError_output[$sKey] = $tpl2->generate($cfg['templates']['linkchecker_test_nothing'], 1);
        }
        $tpl->set('s', 'ERRORS_SHOW_' . strtoupper($sKey), $aError_output[$sKey]);
        if (count($aErrors[$sKey]) > 0) {
            $tpl->set('s', 'ERRORS_COUNT_ERRORS_' . strtoupper($sKey), '<span style="color: #FF0000;">' . count($aErrors[$sKey]) . '</span>');
        } else {
            $tpl->set('s', 'ERRORS_COUNT_ERRORS_' . strtoupper($sKey), count($aErrors[$key]));
        }
    }
    $tpl->generate($cfg['templates']['linkchecker_test']);
    /* Cache */
    // Remove older cache
    $oCache->remove($aCacheName['errors'], intval($_GET['mode']));
    // Build new cache
    $oCache->save(serialize($aErrors), $aCacheName['errors'], intval($_GET['mode']));
    $oCache->save($iErrors_count_checked, $aCacheName['errorscount'], intval($_GET['mode']));
}
// Log
if ($cronjob != true) {
    $backend->log(0, 0, $client, $lang, $action);
}
Exemplo n.º 21
0
 /**
  * Removes an access token
  * 
  * @param HTTP_OAuth_Store_Data $data The access token data
  * 
  * @return bool true on success, false or PEAR_Error on failure
  */
 public function removeAccessToken(HTTP_OAuth_Store_Data $data)
 {
     $this->setOptions(self::TYPE_ACCESS);
     $key = $this->getAccessTokenKey($data->consumerUserID, $data->providerName);
     return $this->cache->remove($key);
 }
Exemplo n.º 22
0
 /**
  * 删除Cache文件
  * @param Cache_Lite $oCache
  * @param string $id
  * @param string $group
  */
 public static function removeCache($oCache, $id, $group)
 {
     return $oCache->remove($id, $group);
 }