• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂d4dfbca11989579dcbba878b5c55e52f2526f96e (tree)
時間2016-12-09 06:26:10
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

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

Change Summary

差異

--- a/cache/autolink.dat
+++ /dev/null
@@ -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-
--- a/lib/file.php
+++ b/lib/file.php
@@ -871,3 +871,20 @@ function pkwk_file_get_contents($filename) {
871871 flock($fp, LOCK_UN);
872872 return $file;
873873 }
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+}
--- a/lib/pukiwiki.php
+++ b/lib/pukiwiki.php
@@ -98,6 +98,7 @@ if (isset($retvars['body']) && $retvars['body'] != '') {
9898 $vars['cmd'] = 'read';
9999 $vars['page'] = & $base;
100100
101+ prepare_display_materials();
101102 $body = convert_html(get_source($base));
102103 }
103104