config.sample.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <?php
  2. #目录设置,不能更改
  3. require_once __DIR__."/dir.php";
  4. #域名设置
  5. define(WWW_DOMAIN_NAME,"sg.wikipali.org");
  6. define(RPC_DOMAIN_NAME,"rpc.wikipali.org");
  7. /*
  8. 电子邮件设置
  9. PHPMailer
  10. */
  11. define("Email", [
  12. "Host"=>"smtp.gmail.com",//Set the SMTP server to send through
  13. "SMTPAuth"=>true,//Enable SMTP authentication
  14. "Username"=>'your@gmail.com',//SMTP username
  15. "Password"=>'your_password',//SMTP password
  16. "Port"=>465,//TCP port to connect to 465; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
  17. "From"=>"your@gmail.com",
  18. "Sender"=>"sender"
  19. ]);
  20. /*
  21. 数据库设置
  22. */
  23. define("Database",[
  24. "type"=>"pgsql",
  25. "port"=>5432,
  26. "name"=>"mint",
  27. "sslmode" => "disable",
  28. "user" => "postgres",
  29. "password" => "123456"
  30. ]);
  31. define("_DB_ENGIN_", Database["type"]);
  32. define("_DB_HOST_", Database["server"]);
  33. define("_DB_PORT_", Database["port"]);
  34. define("_DB_NAME_", Database["name"]);
  35. define("_DB_USERNAME_", Database["user"]);
  36. define("_DB_PASSWORD_", Database["password"]);
  37. /*
  38. Redis 设置,
  39. 使用集群
  40. */
  41. define("Redis",[
  42. "hosts" => ["127.0.0.1:6376", "127.0.0.1:6377", "127.0.0.1:6378"],
  43. "password" => "",
  44. "db" => 0,
  45. "prefix"=>"aaa://"
  46. ]);
  47. /*
  48. 数据表
  49. */
  50. //语料库数据表 pali canon db file
  51. /*
  52. 巴利语料模版表
  53. 运行app/install/db_insert_templet.php 刷库
  54. */
  55. define("_FILE_DB_PALICANON_TEMPLET_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  56. //define("_FILE_DB_PALICANON_TEMPLET_","sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/templet.db3");
  57. define("_TABLE_PALICANON_TEMPLET_","wbw_templet");
  58. /*
  59. 标题资源表
  60. app/install/db_update_toc.php 刷库
  61. */
  62. define("_FILE_DB_RESRES_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  63. //define("_FILE_DB_RESRES_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/res.db3");
  64. define("_TABLE_RES_INDEX_","res_index");
  65. /*
  66. 巴利语料段落表
  67. 刷库 app/install/db_insert_palitext.php
  68. 更新 app/install/db_update_palitext.php
  69. */
  70. define("_FILE_DB_PALITEXT_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  71. //define("_FILE_DB_PALITEXT_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_text.db3");
  72. define("_TABLE_PALI_TEXT_","pali_text");
  73. define("_TABLE_PALI_BOOK_NAME_","books");
  74. #单词表部分
  75. /*
  76. 以书为单位的单词汇总表
  77. 填充 /app/install/db_insert_bookword_from_csv.php
  78. */
  79. define("_FILE_DB_BOOK_WORD_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  80. //define("_FILE_DB_BOOK_WORD_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/bookword.db3");
  81. define("_TABLE_BOOK_WORD_", "bookword");
  82. /*
  83. 单词索引
  84. /app/install/db_insert_word_from_csv.php
  85. /app/admin/word_index_weight_refresh.php
  86. */
  87. define("_FILE_DB_PALI_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  88. //define("_FILE_DB_PALI_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/paliindex.db3");
  89. define("_TABLE_WORD_", "word");
  90. /*
  91. 92万词
  92. /app/install/db_insert_wordindex_from_csv.php
  93. */
  94. define("_FILE_DB_WORD_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  95. //define("_FILE_DB_WORD_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/wordindex.db3");
  96. define("_TABLE_WORD_INDEX_", "wordindex");
  97. //单词索引=92万词+单词索引
  98. define("_FILE_DB_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  99. //define("_FILE_DB_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/index.db3");
  100. //黑体字数据表
  101. //define("_FILE_DB_BOLD_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  102. define("_FILE_DB_BOLD_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/bold.db3");
  103. define("_TABLE_WORD_BOLD_", "bold");
  104. /*
  105. 单词分析表
  106. 数据迁移: php /deploy/migaration/word_statistics.php
  107. */
  108. define("_FILE_DB_STATISTICS_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  109. //define("_FILE_DB_STATISTICS_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/word_statistics.db3");
  110. define("_TABLE_WORD_STATISTICS_", "word_statistics");
  111. define("_SRC_DB_STATISTICS_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/word_statistics.db3");
  112. define("_SRC_TABLE_WORD_STATISTICS_", "word");
  113. /*
  114. 巴利句子表
  115. 数据迁移: php ./deploy/migaration/20211125155700_pali_sent_org.php
  116. 数据迁移: php ./deploy/migaration/20211125165700-pali_sent-upgrade.php
  117. 数据迁移: php ./deploy/migaration/20211126220400-pali_sent_index-upgrade.php
  118. */
  119. define("_FILE_DB_PALI_SENTENCE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  120. //define("_FILE_DB_PALI_SENTENCE_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sent1.db3");
  121. define("_SRC_DB_PALI_SENTENCE_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sent1.db3");
  122. define("_TABLE_PALI_SENT_", "pali_sent");
  123. define("_TABLE_PALI_SENT_ORG_", "pali_sent_org");
  124. define("_TABLE_PALI_SENT_INDEX_", "pali_sent_index");
  125. /*
  126. 相似句
  127. 数据迁移
  128. php ./deploy/migaration/20211127214800_sent_sim.php
  129. php ./deploy/migaration/20211127214900-sent_sim_index.php
  130. redis:
  131. php ./app/pali_sent/redis_upgrade_pali_sent.php
  132. */
  133. define("_FILE_DB_PALI_SENTENCE_SIM_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  134. //define("_FILE_DB_PALI_SENTENCE_SIM_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sim.db3");
  135. define("_SRC_DB_PALI_SENTENCE_SIM_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sim.db3");
  136. define("_TABLE_SENT_SIM_", "sent_sim");
  137. define("_TABLE_SENT_SIM_INDEX_", "sent_sim_index");
  138. /*
  139. 完成度
  140. 数据迁移
  141. php ./app/upgrade/upgrade_pali_toc.php
  142. */
  143. define("_FILE_DB_PALI_TOC_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  144. //define("_FILE_DB_PALI_TOC_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_toc.db3");
  145. define("_TABLE_PROGRESS_", "progress");
  146. define("_TABLE_PROGRESS_CHAPTER_", "progress_chapter");
  147. //页码对应
  148. //define("_FILE_DB_PAGE_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  149. define("_FILE_DB_PAGE_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pagemap.db3");
  150. # 字典数据表 全部存入redis
  151. #巴缅字典
  152. //define("_DICT_DB_PM_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  153. define("_DICT_DB_PM_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/3rd/pm.db");
  154. define("_TABLE_DICT_PM_", "dict");
  155. #系统规则
  156. //define("_DICT_DB_REGULAR_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  157. define("_DICT_DB_REGULAR_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/sys_regular.db");
  158. define("_TABLE_DICT_REGULAR_", "dict");
  159. #系统不规则
  160. //define("_DICT_DB_IRREGULAR_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  161. define("_DICT_DB_IRREGULAR_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/sys_irregular.db");
  162. define("_TABLE_DICT_IRREGULAR_", "dict");
  163. #自动compone
  164. //define("_DICT_DB_COMP_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  165. define("_DICT_DB_COMP_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/comp.db");
  166. define("_TABLE_DICT_COMP_", "dict");
  167. #参考字典
  168. //define("_FILE_DB_REF_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  169. define("_FILE_DB_REF_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/ref.db");
  170. define("_TABLE_DICT_REF_", "dict");
  171. define("_TABLE_DICT_REF_NAME_LIST_", "info");
  172. #参考字典索引
  173. //define("_FILE_DB_REF_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  174. define("_FILE_DB_REF_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/ref1.db");
  175. define("_TABLE_REF_INDEX_", "dict");
  176. #为了切分复合词 使用的词头表
  177. //define("_FILE_DB_PART_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  178. define("_FILE_DB_PART_", "sqlite:" . __DIR__ . "/../tmp/appdata/dict/system/part.db3");
  179. define("_TABLE_PART_", "part");
  180. # 用户数据表
  181. //读写频繁
  182. # 逐词解析表
  183. #sqlite
  184. define("_FILE_DB_USER_WBW_", "sqlite:" . __DIR__ . "/../tmp/user/user_wbw.db3");
  185. define("_TABLE_SRC_USER_WBW_", "wbw");
  186. define("_TABLE_SRC_USER_WBW_BLOCK_", "wbw_block");
  187. # 译文
  188. #sqlite
  189. define("_FILE_DB_SENTENCE_", "sqlite:" . __DIR__ . "/../tmp/user/sentence.db3");
  190. define("_TABLE_SENTENCE_", "sentence");
  191. define("_TABLE_SENTENCE_BLOCK_", "sent_block");
  192. define("_TABLE_SENTENCE_PR_", "sent_pr");
  193. # 译文编辑历史
  194. #sqlite
  195. define("_FILE_DB_USER_SENTENCE_HISTORAY_", "sqlite:" . __DIR__ . "/../tmp/user/usent_historay.db3");
  196. define("_TABLE_SENTENCE_HISTORAY_", "sent_historay");
  197. # 逐词解析字典
  198. # sqlite
  199. define("_FILE_DB_WBW_", "sqlite:" . __DIR__ . "/../tmp/user/wbw.db3");
  200. define("_TABLE_DICT_WBW_", "wbw");
  201. define("_TABLE_DICT_WBW_INDEX_", "wbw_index");
  202. //写入频繁 读取不频繁
  203. # 用户行为记录
  204. //define("_FILE_DB_PAGE_INDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  205. define("_FILE_DB_USER_ACTIVE_", "sqlite:" . __DIR__ . "/../tmp/user/user_active.db3");
  206. //define("_FILE_DB_USER_ACTIVE_LOG_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  207. define("_FILE_DB_USER_ACTIVE_LOG_", "sqlite:" . __DIR__ . "/../tmp/user/user_active_log.db3");
  208. //读取频繁 写入不频繁
  209. # 用户账号
  210. //define("_FILE_DB_USERINFO_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  211. define("_FILE_DB_USERINFO_", "sqlite:" . __DIR__ . "/../tmp/user/userinfo.db3");
  212. # 版本风格
  213. //define("_FILE_DB_CHANNAL_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  214. define("_FILE_DB_CHANNAL_", "sqlite:" . __DIR__ . "/../tmp/user/channal.db3");
  215. # 文章 文集
  216. //define("_FILE_DB_USER_ARTICLE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  217. define("_FILE_DB_USER_ARTICLE_", "sqlite:" . __DIR__ . "/../tmp/user/article.db3");
  218. # 术语
  219. //define("_FILE_DB_TERM_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  220. define("_FILE_DB_TERM_", "sqlite:" . __DIR__ . "/../tmp/user/dhammaterm.db");
  221. # 协作
  222. //define("_FILE_DB_USER_SHARE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  223. define("_FILE_DB_USER_SHARE_", "sqlite:" . __DIR__ . "/../tmp/user/share.db3");
  224. # 工作组
  225. //define("_FILE_DB_GROUP_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  226. define("_FILE_DB_GROUP_", "sqlite:" . __DIR__ . "/../tmp/user/group.db3");
  227. # 逐词解析文件索引
  228. //define("_FILE_DB_FILEINDEX_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  229. define("_FILE_DB_FILEINDEX_", "sqlite:" . __DIR__ . "/../tmp/user/fileindex.db");
  230. # 课程
  231. //define("_FILE_DB_COURSE_", "pgsql:host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  232. define("_FILE_DB_COURSE_", "sqlite:" . __DIR__ . "/../tmp/user/course.db3");
  233. define("_TABLE_COURSE_","course");
  234. # 用户自定义书
  235. //define("_FILE_DB_USER_CUSTOM_BOOK_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  236. define("_FILE_DB_USER_CUSTOM_BOOK_", "sqlite:" . __DIR__ . "/../tmp/user/custom_book.db3");
  237. # 逐词译和译文编辑消息
  238. //define("_FILE_DB_MESSAGE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  239. define("_FILE_DB_MESSAGE_", "sqlite:" . __DIR__ . "/../tmp/user/message.db");
  240. #点赞
  241. //define("_FILE_DB_LIKE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  242. define("_FILE_DB_LIKE_", "sqlite:" . __DIR__ . "/../tmp/user/like.db3");
  243. //很少使用
  244. # 网站设置
  245. //define("_FILE_DB_HOSTSETTING_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  246. define("_FILE_DB_HOSTSETTING_", "sqlite:" . __DIR__ . "/../tmp/user/hostsetting.db3");
  247. # 用户字典统计数据
  248. //define("_FILE_DB_USER_DICT_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  249. define("_FILE_DB_USER_DICT_", "sqlite:" . __DIR__ . "/../tmp/user/udict.db3");
  250. # 用户图片数据 尚未启用
  251. //define("_FILE_DB_MEDIA_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  252. define("_FILE_DB_MEDIA_", "sqlite:" . __DIR__ . "/../tmp/user/media.db3");
  253. # 评论 尚未启用
  254. //define("_FILE_DB_COMMENTS_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  255. define("_FILE_DB_COMMENTS_", "sqlite:" . __DIR__ . "/../tmp/user/comments.db3");
  256. //define("_FILE_DB_USER_STATISTICS_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  257. define("_FILE_DB_USER_STATISTICS_", "sqlite:" . __DIR__ . "/../tmp/user/statistics.db3");
  258. #权限管理 casbin使用
  259. //define("_FILE_DB_USER_RBAC_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
  260. define("_FILE_DB_USER_RBAC_", __DIR__ . "/../tmp/user/rbac.db3");
  261. # 全文搜索
  262. define("_TABLE_FTS_", "fts_texts");
  263. ?>