Ejemplo n.º 1
0
     }
     break;
     // 一覧表示用のデータキャッシュを消去する
 // 一覧表示用のデータキャッシュを消去する
 case 'clearCache':
     // 一覧表示用データキャッシュをクリア
     if ($viewer_cache_exists) {
         $kvs = P2KeyValueStore::getStore($_conf['iv2_cache_db_path'], P2KeyValueStore::CODEC_SERIALIZING);
         if ($kvs->clear() === false) {
             P2Util::pushInfoHtml('<p>一覧表\示用のデータキャッシュを消去できませんでした。</p>');
         } else {
             P2Util::pushInfoHtml('<p>一覧表\示用のデータキャッシュを消去しました。</p>');
         }
     }
     // コンパイル済みテンプレートを削除
     $result_files = P2Util::garbageCollection($flexy->options['compileDir'], -1, '', '', true);
     $removed_files = $result_files['successed'];
     if (!empty($result_files['failed'])) {
         $info_msg_ht = '<p>以下のコンパイル済みテンプレートが削除できませんでした。</p>';
         $info_msg_ht .= '<ul><li>';
         $info_msg_ht .= implode('</li><li>', array_map('p2h', $result_files['failed']));
         $info_msg_ht .= '</li></ul>';
         P2Util::pushInfoHtml($info_msg_ht);
     }
     break;
     // エラーログを消去する
 // エラーログを消去する
 case 'clearErrorLog':
     $result = $db->query('DELETE FROM ' . $db->quoteIdentifier($ini['General']['error_table']));
     if (DB::isError($result)) {
         P2Util::pushInfoHtml($result->getMessage());
Ejemplo n.º 2
0
         $cache->save($search_profile, $cache_id_profile, $cache_group_profile);
     }
     $regex = mb_convert_encoding($search_profile['profile']['regex'], 'UTF-8', 'CP932');
     if (!empty($search_result['threads'])) {
         foreach (array_keys($search_result['threads']) as $order) {
             $_title = preg_replace($regex, '<b class="filtering">$0</b>', $search_result['threads'][$order]->title);
             $search_result['threads'][$order]->title = preg_replace('|&(?=[^;]*</?b>)|u', '&amp;', $_title);
         }
     }
     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();