修訂 | d4dfbca11989579dcbba878b5c55e52f2526f96e (tree) |
---|---|
時間 | 2016-12-09 06:26:10 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2406 Create cache/autolink.dat automatically
* Create 'cache/autolink.dat' before convert_html() if needed
* Remove 'cache/autolink.dat' from the repositogy and the distribution
@@ -1,3 +0,0 @@ | ||
1 | -(?:\:(?:RenameLog|config\/(?:PageReading(?:\/dict)?|plugin(?:\/(?:attach\/mime-type|referer\/config|tracker(?:\/default(?:\/(?:form|list|page))?)?))?))|PukiWiki\/1\.4(?:\/Manual(?:\/Plugin(?:\/(?:A-D|E-G|H-K|L-N|O-R|S-U|V-Z))?)?)?) | |
2 | -(?!) | |
3 | - |
@@ -871,3 +871,20 @@ function pkwk_file_get_contents($filename) { | ||
871 | 871 | flock($fp, LOCK_UN); |
872 | 872 | return $file; |
873 | 873 | } |
874 | + | |
875 | +/** | |
876 | + * Prepare some cache files for convert_html() | |
877 | + * | |
878 | + * * Make cache/autolink.dat if needed | |
879 | + */ | |
880 | +function prepare_display_materials() { | |
881 | + global $autolink; | |
882 | + if ($autolink) { | |
883 | + // Make sure 'cache/autolink.dat' | |
884 | + $file = CACHE_DIR . PKWK_AUTOLINK_REGEX_CACHE; | |
885 | + if (!file_exists($file)) { | |
886 | + // Re-create autolink.dat | |
887 | + put_lastmodified(); | |
888 | + } | |
889 | + } | |
890 | +} |
@@ -98,6 +98,7 @@ if (isset($retvars['body']) && $retvars['body'] != '') { | ||
98 | 98 | $vars['cmd'] = 'read'; |
99 | 99 | $vars['page'] = & $base; |
100 | 100 | |
101 | + prepare_display_materials(); | |
101 | 102 | $body = convert_html(get_source($base)); |
102 | 103 | } |
103 | 104 |