• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãod5bb0080b40245f642cd5d0353a4d826a70bbdac (tree)
Hora2018-03-01 23:40:07
Autorumorigu <umorigu@gmai...>
Commiterumorigu

Mensagem de Log

BugTrack/560 tracker_list cache mechanism supports limit parameter

Mudança Sumário

Diff

--- a/plugin/tracker.inc.php
+++ b/plugin/tracker.inc.php
@@ -221,36 +221,6 @@ function plugin_tracker_get_page_list($page, $needs_filetime) {
221221 return $page_list;
222222 }
223223
224-
225-/*
226-function plugin_tracker_inline()
227-{
228- global $vars;
229-
230- if (PKWK_READONLY) return ''; // Show nothing
231-
232- $args = func_get_args();
233- if (count($args) < 3)
234- {
235- return FALSE;
236- }
237- $body = array_pop($args);
238- list($config_name,$field) = $args;
239-
240- $config = new Config('plugin/tracker/'.$config_name);
241-
242- if (!$config->read())
243- {
244- return "config file '".htmlsc($config_name)."' not found.";
245- }
246-
247- $config->config_name = $config_name;
248-
249- $fields = plugin_tracker_get_fields($vars['page'],$vars['page'],$config);
250- $fields[$field]->default_value = $body;
251- return $fields[$field]->get_tag();
252-}
253-*/
254224 // フィールドオブジェクトを構築する
255225 function plugin_tracker_get_fields($base,$refer,&$config)
256226 {
@@ -703,7 +673,13 @@ function plugin_tracker_getlist($page,$refer,$config_name,$list,$order='',$limit
703673
704674 $cache_enabled = defined('TRACKER_LIST_USE_CACHE') && TRACKER_LIST_USE_CACHE &&
705675 defined('JSON_UNESCAPED_UNICODE') && defined('PKWK_UTF8_ENABLE');
706- $cache_filepath = CACHE_DIR . encode($page) . '.tracker';
676+ if (is_null($limit)) {
677+ $cache_filepath = CACHE_DIR . encode($page) . '.tracker';
678+ } else if (pkwk_ctype_digit($limit) && 0 < $limit && $limit <= 1000) {
679+ $cache_filepath = CACHE_DIR . encode($page) . '.' . $limit . '.tracker';
680+ } else {
681+ $cache_enabled = false;
682+ }
707683 $cachedata = null;
708684 $cache_format_version = 1;
709685 if ($cache_enabled) {