Procházet zdrojové kódy

Merge branch 'laravel' of https://github.com/visuddhinanda/mint into laravel

visuddhinanda před 4 roky
rodič
revize
32bc1a9d53

+ 8 - 0
README.md

@@ -117,6 +117,14 @@ windows
 cp ./public/app/fts/pali.stop /usr/share/postgresql/14/tsearch_data/
 cp ./public/app/fts/pali.syn /usr/share/postgresql/14/tsearch_data/
 ```
+
+### application encryption key
+
+在<工程目录>下运行
+```
+php artisan key:generate
+```
+
 ### 数据库迁移
 
 在根目录下运行

+ 1 - 1
public/app/admin/db_update_cs6_para.php

@@ -4,7 +4,7 @@ require_once "../public/_pdo.php";
 require_once "../config.php";
 
 PDO_Connect(_FILE_DB_PALITEXT_);
-$query = "SELECT * from "._TABLE_PALI_BOOK_NAME_." where true";
+$query = "SELECT * from "._TABLE_PALI_BOOK_NAME_;
 $books = PDO_FetchAll($query);
 
 PDO_Connect(_FILE_DB_PAGE_INDEX_);

+ 2 - 2
public/app/config.sample.php

@@ -204,8 +204,8 @@ define("_TABLE_REF_INDEX_", _SQLITE_TABLE_REF_INDEX_);
 
 #sqlite
 define("_FILE_DB_USER_WBW_", _SQLITE_DB_USER_WBW_);
-define("_TABLE_SRC_USER_WBW_", _SQLITE_TABLE_SRC_USER_WBW_);
-define("_TABLE_SRC_USER_WBW_BLOCK_", _SQLITE_TABLE_SRC_USER_WBW_BLOCK_);
+define("_TABLE_USER_WBW_", _SQLITE_TABLE_USER_WBW_);
+define("_TABLE_USER_WBW_BLOCK_", _SQLITE_TABLE_USER_WBW_BLOCK_);
 
 
 # 译文

+ 3 - 3
public/app/dict/redis_import_dict.php

@@ -4,9 +4,9 @@
 #例:
 # php redis_import_dict.php ../../dicttext/rich/rech.json
 */
-require_once "../config.php";
-require_once "../install/filelist.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../install/filelist.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
     if ($argc >= 2) {

+ 3 - 3
public/app/dict/redis_import_term.php

@@ -1,12 +1,12 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 $rediskey = "dict://term";
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();
 	if ($redis != false) {
-		$dbh = new PDO(_FILE_DB_TERM_, "", "", array(PDO::ATTR_PERSISTENT => true));
+		$dbh = new PDO(_FILE_DB_TERM_, _DB_USERNAME_, _DB_PASSWORD_, array(PDO::ATTR_PERSISTENT => true));
 		$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 		$query = "SELECT word from term where word !='' group by word";
 		$stmtPali = $dbh->query($query);

+ 2 - 2
public/app/dict/redis_import_user.php

@@ -1,6 +1,6 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 $rediskey = "dict://user";
 if (PHP_SAPI == "cli") {

+ 3 - 3
public/app/dict/redis_pali_word_list.php

@@ -1,7 +1,7 @@
 <?php
-require_once "../config.php";
-require_once "../install/filelist.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../install/filelist.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
     if ($argc >= 2) {

+ 5 - 5
public/app/dict/redis_pali_word_statistic.php

@@ -1,9 +1,9 @@
 <?php
-require_once "../config.php";
-require_once "../install/filelist.php";
-require_once "../redis/function.php";
-        $redis = redis_connect();
-		$strKey='pali://wordstatisitic.hash';		
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../install/filelist.php";
+require_once __DIR__."/../redis/function.php";
+$redis = redis_connect();
+$strKey='pali://wordstatisitic.hash';		
 if (PHP_SAPI == "cli") {
     if ($argc >= 2) {
         $command = $argv[1];

+ 2 - 2
public/app/dict/redis_pm_part.php

@@ -1,6 +1,6 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();

+ 2 - 2
public/app/dict/redis_ref_with_mean.php

@@ -1,6 +1,6 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();

+ 3 - 3
public/app/dict/redis_refresh_first_mean.php

@@ -1,7 +1,7 @@
 <?php
-require_once "../config.php";
-require_once '../public/_pdo.php';
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__.'/../public/_pdo.php';
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();

+ 2 - 2
public/app/dict/redis_split_part.php

@@ -1,6 +1,6 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();

+ 2 - 2
public/app/dict/redis_sys_rgl_part.php

@@ -1,6 +1,6 @@
 <?php
-require_once "../config.php";
-require_once "../redis/function.php";
+require_once __DIR__."/../config.php";
+require_once __DIR__."/../redis/function.php";
 
 if (PHP_SAPI == "cli" || isset($_COOKIE["userid"])) 
 {

+ 1 - 1
public/app/redis/function.php

@@ -1,5 +1,5 @@
 <?php
-require_once "../config.php";
+require_once __DIR__."/../config.php";
 function redis_connect()
 {
 	try {

+ 6 - 6
public/app/search/paliword_sc.php

@@ -44,18 +44,18 @@ if (isset($_GET["page"])) {
 if (count($arrWordList) > 1) {
 	# 查询多个词
 	$out_data = array();
-    
+    /*
     PDO_Connect(_FILE_DB_PALITEXT_);
     # 首先精确匹配
     $words = implode(" ", $arrWordList);
     $query = "SELECT book,paragraph, text as content FROM "._TABLE_PALI_TEXT_." WHERE text like ?  LIMIT ? OFFSET ?";
     $Fetch1 = PDO_FetchAll($query, array("%{$words}%", $_pagesize, $_page * $_pagesize));
     
-
-	/*
-	postgresql full text search
+*/
+	
+	#postgresql full text search
     $dns = _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";";
-    PDO_Connect(_FILE_DB_PALITEXT_,_DB_USERNAME_,_DB_PASSWORD_);
+    PDO_Connect($dns,_DB_USERNAME_,_DB_PASSWORD_);
 
     $query = "SELECT
     ts_rank('{0.1, 0.2, 0.4, 1}',
@@ -79,7 +79,7 @@ if (count($arrWordList) > 1) {
     ORDER BY rank DESC
     LIMIT 40;";
     $Fetch1 = PDO_FetchAll($query, array($word, $word, $word, $word, $word));
-	*/    
+	
     foreach ($Fetch1 as $key => $value) {
         # code...
         $newRecode["title"] = $_dbPaliText->getTitle($value["book"], $value["paragraph"]);

+ 2 - 2
public/app/table.php

@@ -173,8 +173,8 @@ define("_PG_TABLE_PROGRESS_CHAPTER_", "progress_chapters");
 # 逐词解析表
 #sqlite
 define("_SQLITE_DB_USER_WBW_", "sqlite:" . __DIR__ . "/../tmp/user/user_wbw.db3");
-define("_SQLITE_TABLE_SRC_USER_WBW_", "wbw");
-define("_SQLITE_TABLE_SRC_USER_WBW_BLOCK_", "wbw_block");
+define("_SQLITE_TABLE_USER_WBW_", "wbw");
+define("_SQLITE_TABLE_USER_WBW_BLOCK_", "wbw_block");
 
 //PostgreSQL
 define("_PG_DB_USER_WBW_", _PDO_DB_DSN_);

+ 24 - 0
public/deploy/upgrade_redis.sh

@@ -0,0 +1,24 @@
+#!/bin/sh
+
+date
+php ../app/dict/redis_import_dict.php ../../dicttext/system/system.json
+date
+php ../app/dict/redis_import_dict.php ../../dicttext/rich/rich.json
+date
+php ../app/dict/redis_import_dict.php ../../tmp/dict_text/comp.json
+date
+php ../app/dict/redis_import_term.php
+date
+php ../app/dict/redis_import_user.php
+date
+php ../app/dict/redis_ref_with_mean.php
+date
+php ../app/dict/redis_refresh_first_mean.php
+date
+php ../app/dict/redis_sys_rgl_part.php
+date
+php ../app/dict/redis_pm_part.php
+date
+php ../app/pali_sent/redis_upgrade_pali_sent.php
+
+date