Przeglądaj źródła

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

bhikkhu-kosalla-china 4 lat temu
rodzic
commit
ff928ebe63
67 zmienionych plików z 1328 dodań i 497 usunięć
  1. 0 0
      .env-global/.env
  2. 9 0
      .env.example
  3. 1 1
      .gitignore
  4. 109 20
      README.md
  5. 3 3
      app/Console/Commands/InstallPaliText.php
  6. 1 0
      app/Console/Commands/InstallWbwTemplate.php
  7. 64 2
      app/Console/Commands/InstallWordBook.php
  8. 187 0
      app/Console/Commands/UpgradePaliText.php
  9. 126 0
      app/Console/Commands/UpgradePaliToc.php
  10. 2 0
      app/Models/BookWord.php
  11. 1 0
      app/Models/PaliText.php
  12. 2 0
      app/Models/ResIndex.php
  13. 35 0
      change-logs.md
  14. 3 15
      config/app.php
  15. 45 0
      deploy/README.md
  16. 2 4
      deploy/group_vars/all.yml
  17. 7 7
      deploy/mint.yml
  18. 0 5
      deploy/roles/deploy/main.yml
  19. 1 0
      deploy/roles/mint-assets/files/.gitignore
  20. 16 0
      deploy/roles/mint-assets/tasks/main.yml
  21. 10 0
      deploy/roles/mint-assets/templates/nginx.conf.j2
  22. 63 0
      deploy/roles/mint-clone/main.yml
  23. 14 0
      deploy/roles/mint-clone/templates/config-v1.js.j2
  24. 60 0
      deploy/roles/mint-clone/templates/config-v1.php.j2
  25. 58 0
      deploy/roles/mint-clone/templates/env-v2.j2
  26. 0 0
      deploy/roles/mint-db/tasks/main.yml
  27. 8 0
      deploy/roles/mint-www/tasks/main.yml
  28. 33 0
      deploy/roles/mint-www/templates/nginx.conf.j2
  29. 12 3
      deploy/roles/ubuntu/tasks/main.yml
  30. 1 0
      public/app/.gitignore
  31. 6 11
      public/app/admin/word_index_weight_refresh.php
  32. 1 1
      public/app/article/article.js
  33. 2 1
      public/app/article/my_article.js
  34. 0 0
      public/app/config.dir.php
  35. 16 2
      public/app/config.sample.js
  36. 14 257
      public/app/config.sample.php
  37. 257 0
      public/app/config.table.php
  38. 2 2
      public/app/db/user.php
  39. 7 7
      public/app/dict/redis_import_dict.php
  40. 4 1
      public/app/dict/redis_import_term.php
  41. 1 1
      public/app/dict/redis_import_user.php
  42. 5 2
      public/app/dict/redis_pm_part.php
  43. 1 1
      public/app/dict/redis_ref_with_mean.php
  44. 4 4
      public/app/dict/redis_refresh_first_mean.php
  45. 4 2
      public/app/dict/redis_sys_rgl_part.php
  46. 4 4
      public/app/fts/sql.php
  47. 6 6
      public/app/install/db_insert_bookword_from_csv_cli.php
  48. 14 12
      public/app/install/db_insert_palitext_cli.php
  49. 11 16
      public/app/install/db_insert_templet_cli.php
  50. 5 10
      public/app/install/db_insert_word_from_csv_cli.php
  51. 6 6
      public/app/install/db_insert_wordindex_from_csv_cli.php
  52. 13 17
      public/app/install/db_update_palitext_cli.php
  53. 7 7
      public/app/install/db_update_toc_cli.php
  54. 3 2
      public/app/nissaya/nissaya.js
  55. 6 6
      public/app/pali_sent/redis_upgrade_pali_sent.php
  56. 2 1
      public/app/redis/function.php
  57. 3 1
      public/app/studio/js/index_mydoc.js
  58. 2 2
      public/app/term/note.js
  59. 2 2
      public/app/ucenter/invite.php
  60. 5 3
      v1/scripts/migrations/20211125155600_word_statistics.php
  61. 6 6
      v1/scripts/migrations/20211125155700_pali_sent_org.php
  62. 6 6
      v1/scripts/migrations/20211125165700-pali_sent-upgrade.php
  63. 4 4
      v1/scripts/migrations/20211126220400-pali_sent_index-upgrade.php
  64. 6 6
      v1/scripts/migrations/20211127214800_sent_sim.php
  65. 4 4
      v1/scripts/migrations/20211127214900-sent_sim_index.php
  66. 5 5
      v1/scripts/migrations/20211202084900_init_pali_serieses.php
  67. 11 19
      v1/scripts/upgrade_redis.sh

+ 0 - 0
.env-global/.env


+ 9 - 0
.env.example

@@ -1,3 +1,7 @@
+BASE_DIR="/workspace/.env.global"
+CACHE_DIR="${BASE_DIR}/cache"
+TMP_DIR="${BASE_DIR}/tmp"
+
 APP_NAME=Laravel
 APP_ENV=local
 APP_KEY=
@@ -50,3 +54,8 @@ PUSHER_APP_CLUSTER=mt1
 
 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
 MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
+
+RPC_SERVER="https://rpc.wikipali.org"
+ASSETS_SERVER="https://assets-hk.wikipali.org"
+HELP_SERVER="https://help-hk.wikipali.org"
+GRAMMAR_SERVER="https://grammar-hk.wikipali.org"

+ 1 - 1
.gitignore

@@ -4,7 +4,7 @@
 /storage/*.key
 /vendor/
 /tmp/
-.env
+/.env
 .env.backup
 .phpunit.result.cache
 docker-compose.override.yml

+ 109 - 20
README.md

@@ -19,8 +19,19 @@
 - npm or yarn
 - vscode
 
+## 目录
+
+目录遵从Laravel目录设置。有以下几点差别
+
+- public/ 包含旧版php程序的全部文件
+- public/tmp 旧版资源文件夹 对于旧版到新版的迁移。**应该将旧版 /tmp 拷贝到 /public**
+- v1 旧版数据迁移任务脚本
+- deploy 运维代码 
+
 ## 安装
 
+>请注意。此安装方法**只针对开发人员**。生产线请参考[deploy/README.md](deploy/README.md)
+
 ### 开发环境
 
 使用 Linux 的开发者请参阅 [<项目文件夹>/docker/readme.md](docker/readme.md) 容器中包含了全部开发环境。请忽略下面关于开发环境的安装。
@@ -61,7 +72,7 @@ Fork https://github.com/iapt-platform/mint 到你自己的仓库
 ### Clone
 
 ```
-git clone https://github.com/<your>/mint.git  --recurse-submodules
+git clone https://github.com/<your>/mint.git
 
 ```
 
@@ -88,7 +99,9 @@ npm install
 
 复制 `<项目目录>/.env.example` 的一个副本。改文件名为 `.env`
 
-修改`.env`,为你的db配置
+修改`.env`
+
+**db配置**
 ```
 DB_CONNECTION=pgsql
 DB_HOST=127.0.0.1
@@ -98,27 +111,101 @@ DB_USERNAME=postgres
 DB_PASSWORD=你的数据库密码
 ```
 
+**ASSETS_SERVER**
+
+ASSETS_SERVER :网站资源文件,非用户的图片,音频,视频
+
+- 对应/public/tmp/ 目录 开发线可以设置为 http://127.0.0.1:8000/tmp(ip port根据你的dev server修改)
+- 所有文件存储在 https://drive.google.com/drive/folders/1-4dn4juD-0-lsKndDui2W9nT9wcS_Y33?usp=sharing
+- 开发线可自行下载放到/public/tmp/
+- 或直接引用离您最近的assets server
+
+
 #### public/app/config.php
 
 复制 `<项目目录>/public/app/config.example.php` 改文件名为`config.php`
-修改`config.php`,为你的db配置
+
+修改`config.php`
+
+**db 设置**
 ```
 define("Database",[
 	"type"=>"pgsql",
 	"server"=>"localhost",
 	"port"=>5432,
-	"name"=>"你的数据库名",
+	"name"=>"<database name>",
 	"sslmode" => "disable",
-	"user" => "postgres",
-	"password" => "你的数据库密码"
+	"user" => "<user name>",
+	"password" => "<your db password>"
+]);
+```
+
+
+**Redis 设置**
+```
+define("Redis",[
+	"host" => "<host ip>",
+	"port" => <port>,
+	"password" => "<redis password>",
+	"prefix"=>"aaa://"
 ]);
 ```
 
+**ASSETS_SERVER**
+
+**HELP_SERVER**
+
+**GRAMMAR_SERVER**
+
+参照下文 config.js
+ 
 #### public/app/config.js
 
-复制 `<项目目录>/public/app/config.example.js` 改文件名为 `config.js`
+复制 `<项目目录>/public/app/config.example.js` 改文件名为`config.js`
 
+修改`config.js`
 
+**ASSETS_SERVER**
+
+ASSETS_SERVER :网站资源文件,非用户的图片,音频,视频
+
+- 对应/public/tmp/ 目录
+- 所有文件存储在 https://drive.google.com/drive/folders/1-4dn4juD-0-lsKndDui2W9nT9wcS_Y33?usp=sharing
+- 开发线可自行下载放到/public/tmp/
+- 或直接引用离您最近的assets server
+
+范例:
+>ip port根据你的dev server修改
+
+```
+var ASSETS_SERVER = "http://127.0.0.1:8000/tmp";
+```
+
+**HELP_SERVER**
+
+网站帮助文档
+
+- 直接引用离您最近的 help server
+
+范例:
+>ip port根据你的 dev server 修改
+
+```
+var HELP_SERVER = "https://help-hk.wikipali.org";
+```
+
+**GRAMMAR_SERVER**
+
+语法手册文档
+
+- 直接引用离您最近的 help server
+
+范例:
+>ip port根据你的 dev server 修改
+
+```
+var GRAMMAR_SERVER = "https://grammar-hk.wikipali.org";
+```
 
 ### 复制巴利语全文搜索单词表
 
@@ -160,39 +247,41 @@ php artisan key:generate
 php artisan migrate
 ```
 
-### 语料数据库填充
+### Redis数据库填充
+
+在命令行运行<项目目录>下面的命令
 
 **Liunx**
 ```dash
-cd public/deploy
-sh ./install.sh
+cd ./v1/scripts
+sh ./redis_upgrade.sh
 ```
 
 **Window**
 ```dash
-cd public/deploy
-./install.bat
+cd ./v1/scripts
+./redis_upgrade.bat
 ```
-运行时间较长。本地开发环境大约4小时。
 
-### Redis数据库填充
-
-在命令行运行<项目目录>下面的命令
+### 语料数据库填充
 
 **Liunx**
 ```dash
-cd public/deploy
-sh ./redis_upgrade.sh
+cd ./v1/scripts
+sh ./install.sh
 ```
 
 **Window**
 ```dash
-cd public/deploy
-./redis_upgrade.bat
+cd ./v1/scripts
+./install.bat
 ```
 运行时间较长。本地开发环境大约4小时。
 
 
+运行时间较长。本地开发环境大约4小时。
+
+
 
 ### 运行dev server
 

+ 3 - 3
app/Console/Commands/InstallPaliText.php

@@ -5,6 +5,7 @@ namespace App\Console\Commands;
 use Illuminate\Console\Command;
 use App\Models\PaliText;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 
 class InstallPaliText extends Command
 {
@@ -77,7 +78,6 @@ class InstallPaliText extends Command
 					if (substr($data, 0, 2) === "<p") {
 						array_push($pali_text_array, $data);
 					}
-			
 				}
 				fclose($fpPaliText);
 				//$this->info("pali text load:" . $htmlFile . PHP_EOL);
@@ -135,9 +135,9 @@ class InstallPaliText extends Command
 						'toc'=>$toc,
 						'text'=>$oneParam[6],
 						'html'=>$oneParam[5],
-						'lenght'=>mb_strlen($oneParam[6], "UTF-8")	
+						'lenght'=>mb_strlen($oneParam[6], "UTF-8"),
 					];
-					PaliText::insert($params);
+					PaliText::create($params);
 				}
 				
 			});

+ 1 - 0
app/Console/Commands/InstallWbwTemplate.php

@@ -5,6 +5,7 @@ namespace App\Console\Commands;
 use Illuminate\Console\Command;
 use App\Models\WbwTemplate;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 
 class InstallWbwTemplate extends Command
 {

+ 64 - 2
app/Console/Commands/InstallWordBook.php

@@ -3,6 +3,9 @@
 namespace App\Console\Commands;
 
 use Illuminate\Console\Command;
+use App\Models\BookWord;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 
 class InstallWordBook extends Command
 {
@@ -11,14 +14,14 @@ class InstallWordBook extends Command
      *
      * @var string
      */
-    protected $signature = 'command:name';
+    protected $signature = 'install:wordbook {from?} {to?}';
 
     /**
      * The console command description.
      *
      * @var string
      */
-    protected $description = 'Command description';
+    protected $description = 'install palibook word list in each book';
 
     /**
      * Create a new command instance.
@@ -37,6 +40,65 @@ class InstallWordBook extends Command
      */
     public function handle()
     {
+		$startTime = time();
+
+		$this->info("instert word in palibook ");
+		Log::info("instert word in palibook ");
+
+		$_from = $this->argument('from');
+		$_to = $this->argument('to');
+		if(empty($_from) && empty($_to)){
+			$_from = 1;
+			$_to = 217;
+		}else if(empty($_to)){
+			$_to = $_from;
+		}
+
+		$bar = $this->output->createProgressBar($_to-$_from+1);
+
+		for ($book=$_from; $book <= $_to; $book++) { 
+			Log::info("doing ".($book));
+
+			#删除目标数据库中数据
+			BookWord::where('book', $book)->delete();
+
+			//分类汇总得到单词表
+			$bookword = array();
+			$fileId = $book-1;
+			if (($fpoutput = fopen(config("app.path.paliword_book") . "/{$fileId}_words.csv", "r")) !== false) {
+				$count = 0;
+				while (($data = fgetcsv($fpoutput, 0, ',')) !== false) {
+					$book = $data[1];
+					if (isset($bookword[$data[3]])) {
+						$bookword[$data[3]]++;
+					} else {
+						$bookword[$data[3]] = 1;
+					}
+		
+					$count++;
+				}
+			}else{
+				Log::error("open csv fail");
+				continue;
+			}
+			DB::transaction(function ()use($book,$bookword) {
+				foreach ($bookword as $key => $value) {
+					$newData = [
+						'book'=>$book,
+						'wordindex'=>$key,
+						'count'=>$value,
+					];
+					BookWord::create($newData);				
+				}
+			});
+			$bar->advance();
+		}
+		$bar->finish();
+
+		$msg = "all done in ". time()-$startTime . "s";
+		$this->info($msg.PHP_EOL);
+		Log::info($msg);
+		
         return 0;
     }
 }

+ 187 - 0
app/Console/Commands/UpgradePaliText.php

@@ -0,0 +1,187 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Models\PaliText;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
+
+class UpgradePaliText extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'upgrade:palitext {from?} {to?}';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+		$this->info("upgrade pali text");
+		$startTime = time();
+
+		$_from = $this->argument('from');
+		$_to = $this->argument('to');
+		if(empty($_from) && empty($_to)){
+			$_from = 1;
+			$_to = 217;
+		}else if(empty($_to)){
+			$_to = $_from;
+		}
+#载入文件列表
+		$fileListFileName = config("app.path.palitext_filelist");
+
+		$filelist = array();
+
+		if (($handle = fopen($fileListFileName, 'r')) !== false) {
+			while (($filelist[] = fgetcsv($handle, 0, ',')) !== false) {
+			}
+		}
+
+		$bar = $this->output->createProgressBar($_to-$_from+1);
+
+		for ($from=$_from; $from <= $_to; $from++) {
+			$inputRow = 0;
+			
+			$arrInserString = array();
+			#载入csv数据
+			$FileName = $filelist[$from-1][1];
+			$csvFile = config("app.path.palicsv") .'/'. $FileName .'/'. $FileName.'_pali.csv';
+			if (($fp = fopen($csvFile, "r")) !== false) {
+				while (($data = fgetcsv($fp, 0, ',')) !== false) {
+					if ($inputRow > 0) {
+						array_push($arrInserString, $data);
+					}
+					$inputRow++;
+				}
+				fclose($fp);
+				Log::info("csv load:" . $csvFile);
+			} else {
+				$this->error( "can not open csv file. filename=" . $csvFile. PHP_EOL) ;
+				Log::error( "can not open csv file. filename=" . $csvFile) ;
+				continue;
+			}
+			$title_data = PaliText::where('book',$from)->orderby('paragraph','asc')->get();
+			DB::transaction(function ()use($from,$arrInserString,$title_data) {
+				$paragraph_count = count($title_data);
+				$paragraph_info = array();
+				$paragraph_info[] = array($from, -1, $paragraph_count, -1, -1, -1);
+
+
+				for ($iPar = 0; $iPar < count($title_data); $iPar++) {
+					$title_data[$iPar]["level"] = $arrInserString[$iPar][3];
+				}
+
+
+				for ($iPar = 0; $iPar < count($title_data); $iPar++) {
+					$book = $from ;
+					$paragraph = $title_data[$iPar]["paragraph"];
+
+					if ((int) $title_data[$iPar]["level"] == 8) {
+						$title_data[$iPar]["level"] = 100;
+					}
+
+					$curr_level = (int) $title_data[$iPar]["level"];
+					# 计算这个chapter的段落数量
+					$length = -1;
+				
+					
+					for ($iPar1 = $iPar + 1; $iPar1 < count($title_data); $iPar1++) {
+						$thislevel = (int) $title_data[$iPar1]["level"];
+						if ($thislevel <= $curr_level) {
+							$length = (int) $title_data[$iPar1]["paragraph"] - $paragraph;
+							break;
+						}
+					}
+
+					if ($length == -1) {
+						$length = $paragraph_count - $paragraph + 1;
+					}
+
+
+					$prev = -1;
+					if ($iPar > 0) {
+						for ($iPar1 = $iPar - 1; $iPar1 >= 0; $iPar1--) {
+							if ($title_data[$iPar1]["level"] == $curr_level) {
+								$prev = $title_data[$iPar1]["paragraph"];
+								break;
+							}
+						}
+					}
+
+					$next = -1;
+					if ($iPar < count($title_data) - 1) {
+						for ($iPar1 = $iPar + 1; $iPar1 < count($title_data); $iPar1++) {
+							if ($title_data[$iPar1]["level"] == $curr_level) {
+								$next = $title_data[$iPar1]["paragraph"];
+								break;
+							}
+						}
+					}
+
+					$parent = -1;
+					if ($iPar > 0) {
+						for ($iPar1 = $iPar - 1; $iPar1 >= 0; $iPar1--) {
+							if ($title_data[$iPar1]["level"] < $curr_level) {
+								$parent = $title_data[$iPar1]["paragraph"];
+								break;
+							}
+						}
+					}
+					//计算章节包含总字符数
+					$iChapter_strlen = 0;
+
+					for ($i = $iPar; $i < $iPar + $length; $i++) {
+						$iChapter_strlen += $title_data[$i]["lenght"];
+					}
+					
+					$newData = [
+						'level' => $arrInserString[$iPar][3],
+						'toc' => $arrInserString[$iPar][5],
+						'chapter_len' => $length,
+						'next_chapter' => $next,
+						'prev_chapter' => $prev,
+						'parent' => $parent,
+						'chapter_strlen'=> $iChapter_strlen,
+					];
+					PaliText::where('book',$book)
+							->where('paragraph',$paragraph)
+							->update($newData);
+
+					if ($curr_level > 0 && $curr_level < 8) {
+						$paragraph_info[] = array($book, $paragraph, $length, $prev, $next, $parent);
+					}
+				}
+			});
+			$bar->advance();
+		}
+		$bar->finish();
+	
+		$this->info("instert pali text finished. in ". time()-$startTime . "s" .PHP_EOL);
+		Log::info("instert pali text finished. in ". time()-$startTime . "s");
+        return 0;
+    }
+}

+ 126 - 0
app/Console/Commands/UpgradePaliToc.php

@@ -0,0 +1,126 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Models\ResIndex;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
+
+class UpgradePaliToc extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'upgrade:palitoc {lang} {from?} {to?}';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'upgrade pali toc from csv';
+    protected $usage = 'upgrade:palitoc lang from to';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+		$this->info("upgrade pali text");
+		$startTime = time();
+
+		$_lang = $this->argument('lang');
+		$_from = $this->argument('from');
+		$_to = $this->argument('to');
+		if(empty($_from) && empty($_to)){
+			$_from = 1;
+			$_to = 217;
+		}else if(empty($_to)){
+			$_to = $_from;
+		}
+		if ($_lang == "pali") {
+			$type = 1;
+		} else {
+			$type = 2;
+		}
+
+		$bar = $this->output->createProgressBar($_to-$_from+1);
+		for ($from=$_from; $from <= $_to; $from++) {
+			// 打开csv文件并读取数据
+			$strFileName = config("app.path.pali_title") . "/{$from}_{$_lang}.csv";
+			if(!file_exists($strFileName)){
+				continue;
+			}
+			#删除目标数据库中数据
+			ResIndex::where('book', $from)
+					->where('language', $_lang)
+					->delete();
+			DB::transaction(function ()use($from,$strFileName,$type,$_lang) {
+				$inputRow = 0;
+				if (($fp = fopen($strFileName, "r")) !== false) {
+					while (($data = fgetcsv($fp, 0, ',')) !== false) {
+						if ($inputRow > 0 && $data[3] != 100 && !empty($data[6])) {
+							if (isset($data[7])) {
+								$author = $data[7];
+							}else {
+								$author = "cscd4";
+							}
+							$data[6] = mb_substr($data[6],0,1024);
+							
+							$newData = [
+								'book'=>$from,
+								'paragraph'=>$data[2],
+								'title'=>$data[6],
+								'title_en'=>$this->getWordEn($data[6]),
+								'level'=>$data[3],
+								'type'=>$type,
+								'language'=>$_lang,
+								'author'=>$author,
+								'share'=>1,				
+								'create_time'=>time()*1000,
+								'update_time'=>time()*1000,
+							];
+
+							ResIndex::create($newData);
+						}
+						$inputRow++;
+					}
+					fclose($fp);
+					Log::info("res load:" .$strFileName);
+				} else {
+					$this->error("can not open csv $strFileName");
+					Log::error("can not open csv $strFileName");
+				}
+			});
+			$bar->advance();
+		}
+		$bar->finish();
+		$msg = "upgrade pali toc finished. in ". time()-$startTime . "s";
+		$this->info($msg .PHP_EOL);
+		Log::info($msg);
+        return 0;
+    }
+
+	private function  getWordEn($strIn)
+	{
+		$strIn = strtolower($strIn);
+		$search = array('ā', 'ī', 'ū', 'ṅ', 'ñ', 'ṭ', 'ḍ', 'ṇ', 'ḷ', 'ṃ');
+		$replace = array('a', 'i', 'u', 'n', 'n', 't', 'd', 'n', 'l', 'm');
+		return (str_replace($search, $replace, $strIn));
+	}
+}

+ 2 - 0
app/Models/BookWord.php

@@ -8,4 +8,6 @@ use Illuminate\Database\Eloquent\Model;
 class BookWord extends Model
 {
     use HasFactory;
+	protected $fillable = ['book' , 'wordindex', 'count'];
+
 }

+ 1 - 0
app/Models/PaliText.php

@@ -8,4 +8,5 @@ use Illuminate\Database\Eloquent\Model;
 class PaliText extends Model
 {
     use HasFactory;
+	protected $fillable = ['book','paragraph','level','class','toc','text','html','lenght'];
 }

+ 2 - 0
app/Models/ResIndex.php

@@ -8,4 +8,6 @@ use Illuminate\Database\Eloquent\Model;
 class ResIndex extends Model
 {
     use HasFactory;
+	protected $fillable = ['book','paragraph','title','title_en','level','type','language','author','share','create_time','update_time'];
+
 }

+ 35 - 0
change-logs.md

@@ -0,0 +1,35 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+## [1.0.0] - 2022-01-13
+- add redis setting to README.md
+- add .env-global/.env
+- .env -> /.env in .gitignore
+- rename public/app/table.php to table.config.php
+- rename public/app/dir.php to dir.config.php
+- add ASSETS_SERVER to .env.example
+- add ASSETS_SERVER to /public/app/config.sample.js
+
+## [1.0.1] - 2022-01-14
+- /public/app/config.sample.php 变更 移动 config.dir.php 到其他设置的下面 跟其他的 dev config 放在一起 看着比较整齐。
+- remove config.migrate in config.sample.php
+- remove file config.migrate.sample.php
+- finish command Install:wordbook
+
+## [1.0.2] - 2022-01-15
+
+- add HELP_SERVER to .env.example /public/app/config.sample.js /public/app/config.sample.php
+- add GRAMMAR_SERVER to .env.example /public/app/config.sample.js /public/app/config.sample.php
+
+## [1.0.3] - 2022-01-16
+
+- remove WWW_DOMAIN_PROTOCOL WWW_DOMAIN_NAME from config.sample.php
+- rename RPC_DOMAIN_NAME -> RPC_SERVER in config.sample.php
+- remove WWW_DOMAIN_NAME  from config.sample.js
+- rename RPC_DOMAIN_NAME -> RPC_SERVER in config.sample.js
+- add RPC_SERVER to .env.example

+ 3 - 15
config/app.php

@@ -244,20 +244,8 @@ return [
 		'palitext' => public_path('palihtml'),
 		'palitext_filelist' => public_path('palihtml').'/filelist.csv',
 		'palicsv' => public_path('tmp').'/palicsv',
-	],
-
-	'dependence' =>[
-		[
-			'path' => 'pali-sentence',
-			'url' => 'https://github.com/iapt-platform/pali-sentence.git',
-		],
-		[
-			'path' => 'word-statistics',
-			'url' => 'https://github.com/iapt-platform/word-statistics.git',
-		],
-		[
-			'path' => 'pali-similarity',
-			'url' => 'https://github.com/iapt-platform/pali-similarity.git',
-		],
+		'pali_title' => public_path('pali_title'),
+		'paliword' => public_path('paliword'),
+		'paliword_book' => public_path('paliword')."/book",
 	],
 ];

+ 45 - 0
deploy/README.md

@@ -31,6 +31,51 @@ peony -i staging pi.yml -l GROUP
 - [Armbian](https://www.armbian.com/download/)
 - [wiringPi for Orange Pi](https://github.com/orangepi-xunlong/WiringOP)
 
+## Import Database Data
+
+### on deploy a new server
+
+```
+php ../../public/app/install/db_insert_templet_cli.php 1 217
+php ../../public/app/install/db_update_toc_cli.php 1 217 pali
+php ../../public/app/install/db_update_toc_cli.php 1 217 zh-hans
+php ../../public/app/install/db_update_toc_cli.php 1 217 zh-hant
+php ../../public/app/install/db_insert_palitext_cli.php 1 217
+php ../../public/app/install/db_update_palitext_cli.php 1 217
+php ../../public/app/install/db_insert_bookword_from_csv_cli.php 1 217
+php ../../public/app/install/db_insert_word_from_csv_cli.php 1 217
+php ../../public/app/install/db_insert_wordindex_from_csv_cli.php
+
+php ./migrations/20211202084900_init_pali_serieses.php
+php ./migrations/20211125155600_word_statistics.php
+php ./migrations/20211125155700_pali_sent_org.php
+php ./migrations/20211125165700-pali_sent-upgrade.php
+php ./migrations/20211126220400-pali_sent_index-upgrade.php
+php ./migrations/20211127214800_sent_sim.php
+php ./migrations/20211127214900-sent_sim_index.php
+
+php ../../public/app/fts/sql.php
+
+php ../../public/app/admin/word_index_weight_refresh.php 1 217
+```
+
+### on update
+```
+# public/pali_title目录下文件*_pali.csv改变时触发
+php ../../public/app/install/db_update_palitext_cli.php 1 217
+
+# public/pali_title目录下文件其他改变时触发
+php ../../public/app/install/db_update_toc_cli.php 1 217 pali
+php ../../public/app/install/db_update_toc_cli.php 1 217 zh-hans
+php ../../public/app/install/db_update_toc_cli.php 1 217 zh-hant
+
+# public/dependence/pali_sentence/data 目录下文件其他改变时触发
+# TODO 导入pali_sent使用上述目录csv文件。目前用的是sqlite db文件
+php ./migrations/20211125165700-pali_sent-upgrade.php
+php ./migrations/20211126220400-pali_sent_index-upgrade.php
+
+```
+
 ## Crontab
 
 ### Daily

+ 2 - 4
deploy/group_vars/all.yml

@@ -1,10 +1,8 @@
 ansible_user: "deploy"
 ansible_python_interpreter: /usr/bin/python3
-ansible_ssh_private_key_file: "{{inventory_dir}}/.ssh/id_ed25519"
+ansible_ssh_private_key_file: "{{ inventory_dir }}/.ssh/id_ed25519"
 #ansible_ssh_private_key_file: "{{inventory_dir}}/.ssh/id_rsa"
 
-app_deploy_target: "/opt/{{ app_vendor }}/{{ ansible_date_time.iso8601_basic }}"
-app_downloads: "{{ ansible_env.HOME }}/downloads"
-app_backup: "{{ ansible_env.HOME }}/backup"
+app_www_deploy_target: "/var/www/{{ inventory_hostname }}/{{ ansible_date_time.iso8601_basic }}"
 app_python_version: "3.11"
 app_php_version: "8.0"

+ 7 - 7
deploy/mint.yml

@@ -4,16 +4,16 @@
     - ubuntu
     - python3
     - php
+    - mint-clone
 
-- hosts: db
+- hosts: www
   roles:
+    - mint-www
 
-- hosts:
-    - www
-    - 
+- hosts: assets
   roles:
-    - wikipali
+    - mint-assets
 
-- hosts: www
+- hosts: db
   roles:
-    - wikipali
+    - mint-db

+ 0 - 5
deploy/roles/deploy/main.yml

@@ -1,5 +0,0 @@
-- name: Git checkout
-  ansible.builtin.git:
-    repo: 'https://foosball.example.org/path/to/repo.git'
-    dest: /srv/checkout
-    version: release-0.22

+ 1 - 0
deploy/roles/mint-assets/files/.gitignore

@@ -0,0 +1 @@
+/public/

+ 16 - 0
deploy/roles/mint-assets/tasks/main.yml

@@ -0,0 +1,16 @@
+- name: Upload assets folder
+  become: true
+  ansible.builtin.copy:
+    src: public
+    dest: /var/www/{{ inventory_hostname }}
+    owner: www-data
+    group: www-data
+
+- name: upload nginx.conf
+  bacame: true
+  ansible.builtin.template:
+    src: nginx.conf.j2
+    dest: "/etc/nginx/sites-enabled/{{ inventory_hostname }}"
+    owner: www-data
+    group: www-data
+    mode: '0400'

+ 10 - 0
deploy/roles/mint-assets/templates/nginx.conf.j2

@@ -0,0 +1,10 @@
+server {
+    listen 80;
+
+    gzip on;
+    server_name {{ inventory_hostname }};
+    root /var/www/{{ inventory_hostname }};
+
+    access_log off;
+    error_log /var/log/nginx/{{ inventory_hostname }}.error.log warn;
+}

+ 63 - 0
deploy/roles/mint-clone/main.yml

@@ -0,0 +1,63 @@
+- name: Creates directory
+  become: true
+  file:
+    path: "/var/www/{{ inventory_hostname }}"
+    state: directory
+    owner: "{{ ansible_user }}"
+
+- name: Git checkout source code
+  ansible.builtin.git:
+    repo: 'https://github.com/iapt-platform/mint.git'
+    dest: "{{ app_www_deploy_target }}"
+    version: laravel
+
+- name: Install v2 php dependencies
+  ansible.builtin.shell: composer install
+  args:
+    chdir: "{{ app_www_deploy_target }}"
+
+- name: Install v2 nodejs dependencies
+  ansible.builtin.shell: npm install
+  args:
+    chdir: "{{ app_www_deploy_target }}"
+
+# TODO will remove in future
+- name: Install v1 php dependencies
+  ansible.builtin.shell: composer install
+  args:
+    chdir: "{{ app_www_deploy_target }}/public"
+
+# TODO will remove in future
+- name: Install v1 nodejs dependencies
+  ansible.builtin.shell: npm install
+  args:
+    chdir: "{{ app_www_deploy_target }}/public"
+
+- name: .env(v2)
+  bacame: true
+  ansible.builtin.template:
+    src: env-v2.j2
+    dest: "{{ app_www_deploy_target }}/.env"
+    owner: www-data
+    group: www-data
+    mode: '0400'
+
+# TODO will remove in future
+- name: config.php(v1)
+  bacame: true
+  ansible.builtin.template:
+    src: config-v1.php.j2
+    dest: "{{ app_www_deploy_target }}/public/app/config.php"
+    owner: www-data
+    group: www-data
+    mode: '0400'
+
+# TODO will remove in future
+- name: config.js(v1)
+  bacame: true
+  ansible.builtin.template:
+    src: config-v1.js.j2
+    dest: "{{ app_www_deploy_target }}/public/app/config.js"
+    owner: www-data
+    group: www-data
+    mode: '0400'

+ 14 - 0
deploy/roles/mint-clone/templates/config-v1.js.j2

@@ -0,0 +1,14 @@
+var RPC_SERVER="https://rpc.wikipali.org";
+
+/*
+  |---------------
+  |网站资源文件,非用户的图片,音频,视频
+  |---------------
+  |对应/public/tmp/ 目录 开发线可以设置为 http://127.0.0.1:8000/tmp
+  |所有文件存储在 https://drive.google.com/drive/folders/1-4dn4juD-0-lsKndDui2W9nT9wcS_Y33?usp=sharing
+  |开发线可自行下载放到/public/tmp/
+  |或直接引用离您最近的assets server
+  |------------------------
+*/
+
+var ASSETS_SERVER = "https://assets-hk.wikipali.org"

+ 60 - 0
deploy/roles/mint-clone/templates/config-v1.php.j2

@@ -0,0 +1,60 @@
+<?php
+#目录设置,不能更改
+require_once __DIR__."/config.dir.php";
+
+#域名设置
+define("RPC_SERVER","https://rpc.wikipali.org");
+/*
+电子邮件设置
+PHPMailer
+*/
+define("Email", [
+				 "Host"=>"smtp.gmail.com",//Set the SMTP server to send through
+				 "SMTPAuth"=>true,//Enable SMTP authentication
+				 "Username"=>'your@gmail.com',//SMTP username
+				 "Password"=>'your_password',//SMTP password
+				 "Port"=>465,//TCP port to connect to 465; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
+				 "From"=>"your@gmail.com",
+				 "Sender"=>"sender"
+				 ]);
+
+/*
+数据库设置
+*/
+define("Database",[
+	"type"=>"pgsql",
+	"server"=>"localhost",
+	"port"=>5432,
+	"name"=>"mint",
+	"sslmode" => "disable",
+	"user" => "postgres",
+	"password" => "123456"
+]);
+
+
+/*
+Redis 设置,
+*/
+define("Redis",[
+	"host" => "{{ app_redis_host }}",
+	"port" => 6379,
+	"password" => "",
+	"prefix"=>"mint://"
+]);
+
+# 雪花id
+define("SnowFlake",[
+	"DatacenterId"=>1,
+	"WorkerId"=>1
+]);
+/*
+数据表
+*/
+#表设置,此行不能更改
+require_once __DIR__."/config.table.php";
+
+#表名设置,此行不能更改
+require_once __DIR__."/config.migrate.php";
+
+
+?>

+ 58 - 0
deploy/roles/mint-clone/templates/env-v2.j2

@@ -0,0 +1,58 @@
+BASE_DIR="/workspace/.env.global"
+CACHE_DIR="${BASE_DIR}/cache"
+TMP_DIR="${BASE_DIR}/tmp"
+
+APP_NAME={{  }}
+APP_ENV=local
+APP_KEY=
+APP_DEBUG=true
+APP_URL=http://localhost
+
+LOG_CHANNEL=stack
+LOG_DEPRECATIONS_CHANNEL=null
+LOG_LEVEL=debug
+
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=mint_new
+DB_USERNAME=root
+DB_PASSWORD=
+
+BROADCAST_DRIVER=log
+CACHE_DRIVER=file
+FILESYSTEM_DRIVER=local
+QUEUE_CONNECTION=sync
+SESSION_DRIVER=file
+SESSION_LIFETIME=120
+
+MEMCACHED_HOST=127.0.0.1
+
+REDIS_HOST=127.0.0.1
+REDIS_PASSWORD=null
+REDIS_PORT=6379
+
+MAIL_MAILER=smtp
+MAIL_HOST=mailhog
+MAIL_PORT=1025
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
+MAIL_FROM_ADDRESS=null
+MAIL_FROM_NAME="${APP_NAME}"
+
+AWS_ACCESS_KEY_ID=
+AWS_SECRET_ACCESS_KEY=
+AWS_DEFAULT_REGION=us-east-1
+AWS_BUCKET=
+AWS_USE_PATH_STYLE_ENDPOINT=false
+
+PUSHER_APP_ID=
+PUSHER_APP_KEY=
+PUSHER_APP_SECRET=
+PUSHER_APP_CLUSTER=mt1
+
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
+
+ASSETS_SERVER="https://assets-{{ app_cluster_id }}.wikipali.org"

+ 0 - 0
deploy/roles/mint-db/tasks/main.yml


+ 8 - 0
deploy/roles/mint-www/tasks/main.yml

@@ -0,0 +1,8 @@
+- name: upload nginx.conf
+  bacame: true
+  ansible.builtin.template:
+    src: nginx.conf.j2
+    dest: "/etc/nginx/sites-enabled/{{ inventory_hostname }}"
+    owner: www-data
+    group: www-data
+    mode: '0400'

+ 33 - 0
deploy/roles/mint-www/templates/nginx.conf.j2

@@ -0,0 +1,33 @@
+server {
+    listen 80;
+
+    gzip on;
+    server_name {{ inventory_hostname }};
+    root {{ app_www_deploy_target }};
+    client_max_body_size 16M;
+
+    access_log off;
+    error_log /var/log/nginx/{{ inventory_hostname }}.error.log warn;
+
+    location / {
+        index index.html index.php;
+    }
+
+    location ~ /.git/ {
+        deny all;
+    }
+
+    location ~ \.php$ {
+        try_files $fastcgi_script_name =404;
+
+        include fastcgi_params;
+
+        fastcgi_pass			unix:/run/php/php{{ app_php_version }}-fpm.sock;
+        fastcgi_index			index.php;
+        fastcgi_buffers			8 16k;
+        fastcgi_buffer_size		32k;
+
+        fastcgi_param DOCUMENT_ROOT     $realpath_root;
+        fastcgi_param SCRIPT_FILENAME   $realpath_root$fastcgi_script_name;
+    }
+}

+ 12 - 3
deploy/roles/ubuntu/tasks/main.yml

@@ -78,18 +78,22 @@
       - zip
       - unzip
       - nginx
+      - certbot
       - openvpn
       - snmpd
       - systemd-cron
       - systemd-timesyncd
       - screen
       - tmux
+      - hugo
       - python3
       - python3-pip
       - python3-distutils
       - python3-dev
-      - libpq5
-      
+      - libssl-dev
+      - libpq-dev
+      - libmysqlclient-dev
+
 
 - include: locales.yml
 
@@ -140,7 +144,6 @@
     enabled: yes
     masked: no
 
-
 - name: enable cron service
   become: true
   ansible.builtin.systemd:
@@ -148,6 +151,12 @@
     enabled: yes
     masked: no
 
+- name: enable certbot sync
+  ansible.builtin.cron:
+    name: "renew certbot"
+    special_time: monthly
+    job: "/usr/bin/certbot renew --force-renewal"
+
 - name: enable ssh service
   become: true
   ansible.builtin.systemd:

+ 1 - 0
public/app/.gitignore

@@ -2,4 +2,5 @@
 /phpinfo.php
 /path.php
 /config.php
+/config.migrate.php
 /config.js

+ 6 - 11
public/app/admin/word_index_weight_refresh.php

@@ -40,10 +40,10 @@ $dh_word->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 $dh_pali = new PDO( __DB_PALI_INDEX__, _DB_USERNAME_, _DB_PASSWORD_);
 $dh_pali->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
-echo "from=$from to = $to \n";
+fwrite(STDOUT, "from=$from to = $to \n");
 for ($i = $from; $i <= $to; $i++) {
     $time_start = microtime(true);
-    echo "正在处理 book= $i ";
+    fwrite(STDOUT, "正在处理 book= $i ");
     $query = "SELECT max(paragraph) from ".__TABLE_WORD__." where book=?";
 	try {
 		//code...
@@ -57,7 +57,7 @@ for ($i = $from; $i <= $to; $i++) {
 
     if ($row) {
         $max_para = $row[0];
-        echo "段落数量:$max_para ";
+        fwrite(STDOUT, " paragraph :$max_para ");
         for ($j = 0; $j <= $max_para; $j++) {
             # code...
             $query = "SELECT id,book,wordindex,bold from ".__TABLE_WORD__." where book={$i} and paragraph={$j} order by id ASC";
@@ -113,10 +113,8 @@ for ($i = $from; $i <= $to; $i++) {
                         } else {
                             $weight = 100 + $book_weight[$bookId];
                         }
-                        //echo "单独黑体 $weight \n";
                     } else {
                         #连续黑体字
-                        //echo "连续黑体字";
                         $len_sum = 0;
                         $len_curr = 0;
                         for ($iBold = $begin; $iBold <= $end; $iBold++) {
@@ -133,7 +131,6 @@ for ($i = $from; $i <= $to; $i++) {
                         $weight = 10 + $len_curr / $len_sum;
                     }
                 }
-                //echo $weight."\n";
                 $fetch[$iWord]["weight"] = (int) ($weight * 100);
             }
             # 将整段权重写入据库
@@ -146,13 +143,11 @@ for ($i = $from; $i <= $to; $i++) {
             $dh_pali->commit();
             if (!$stmt_weight || ($stmt_weight && $stmt_weight->errorCode() != 0)) {
                 $error = $dh_pali->errorInfo();
-                echo "error - $error[2]";
-            } else {
-                //echo "修改数据库成功 book={$i} paragraph={$j} \n";
+                fwrite(STDERR, "error - $error[2]".PHP_EOL);
             }
         }
     } else {
-        echo "无法获取段落最大值";
+        fwrite(STDERR, "无法获取段落最大值".PHP_EOL);
     }
-    echo "处理时间 :" . (microtime(true) - $time_start). "\n";
+    fwrite(STDOUT, "处理时间 :" . (microtime(true) - $time_start). "\n");
 }

+ 1 - 1
public/app/article/article.js

@@ -46,7 +46,7 @@ function articel_load(id, collection_id) {
 						$("#article_author").html( article_author );
 
 						//将绝对链接转换为 用户连接的主机链接
-						result.content = result.content.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+						result.content = result.content.replace(/[A-z]*.wikipali.org/g,location.host);
 
 						$("#contents").html(note_init(result.content,"",result.owner,result.lang));
 						//处理<code>标签作为气泡注释

+ 2 - 1
public/app/article/my_article.js

@@ -51,8 +51,9 @@ function my_article_list() {
 						html += "</button>";
 						html += "</a></div>";
 						html += "<div style='flex:1;'>";
+						let host = location.protocol + '//' + location.host;
 						html +=
-							"<button class='icon_btn' onclick=\"copy_to_clipboard('"+WWW_DOMAIN_NAME+"/app/article/?id=" +
+							"<button class='icon_btn' onclick=\"copy_to_clipboard('"+host+"/app/article/?id=" +
 							iterator.id +
 							"')\" title='" +
 							gLocal.gui.copy_link +

+ 0 - 0
public/app/dir.php → public/app/config.dir.php


+ 16 - 2
public/app/config.sample.js

@@ -1,2 +1,16 @@
-var WWW_DOMAIN_NAME="sg.wikipali.org";
-var RPC_DOMAIN_NAME="rpc.wikipali.org";
+var RPC_SERVER = "https://rpc.wikipali.org";
+
+/*
+  |---------------
+  |网站资源文件,非用户的图片,音频,视频
+  |---------------
+  |对应/public/tmp/ 目录 开发线可以设置为 http://127.0.0.1:8000/tmp
+  |所有文件存储在 https://drive.google.com/drive/folders/1-4dn4juD-0-lsKndDui2W9nT9wcS_Y33?usp=sharing
+  |开发线可自行下载放到/public/tmp/
+  |或直接引用离您最近的assets server
+  |------------------------
+*/
+
+var ASSETS_SERVER = "https://assets-hk.wikipali.org"
+var HELP_SERVER = "https://help-hk.wikipali.org"
+var GRAMMAR_SERVER = "https://grammar-hk.wikipali.org"

+ 14 - 257
public/app/config.sample.php

@@ -1,11 +1,13 @@
 <?php 
-#目录设置,不能更改
-require_once __DIR__."/dir.php";
+
 
 #域名设置
-define("WWW_DOMAIN_PROTOCOL","https");
-define("WWW_DOMAIN_NAME","www.wikipali.org");
-define("RPC_DOMAIN_NAME","rpc.wikipali.org");
+
+define("RPC_SERVER","https://rpc.wikipali.org");
+define("ASSETS_SERVER","https://assets-hk.wikipali.org");
+define("HELP_SERVER","https://help-hk.wikipali.org");
+define("GRAMMAR_SERVER","https://grammar-hk.wikipali.org");
+
 /*
 电子邮件设置
 PHPMailer
@@ -33,22 +35,14 @@ define("Database",[
 	"password" => "123456"
 ]);
 
-define("_DB_ENGIN_", Database["type"]);
-define("_DB_HOST_", Database["server"]);
-define("_DB_PORT_", Database["port"]);
-define("_DB_NAME_", Database["name"]);
-define("_DB_USERNAME_", Database["user"]);
-define("_DB_PASSWORD_", Database["password"]);
-
 
 /*
 Redis 设置,
-使用集群
 */
 define("Redis",[
-	"hosts" => ["127.0.0.1:6376", "127.0.0.1:6377", "127.0.0.1:6378"],
+	"host" => "127.0.0.1",
+	"port" => 6379,
 	"password" => "",
-	"db" => 0,
 	"prefix"=>"aaa://"
 ]);
 				
@@ -57,252 +51,15 @@ define("SnowFlake",[
 	"DatacenterId"=>1,
 	"WorkerId"=>1
 ]);
-/*
-数据表
-*/
-#表设置,此行不能更改
-require_once __DIR__."/table.php";
-
-/*
-前缀:
-Sqlite:  _SQLITE_
-PostgreSql:  _PG_
-*/
-//语料库数据表 pali canon db file 
-/*
-巴利语料模版表
-运行app/install/db_insert_templet.php 刷库
-*/
-
-define("_FILE_DB_PALICANON_TEMPLET_", _PG_DB_PALICANON_TEMPLET_);
-define("_TABLE_PALICANON_TEMPLET_",_PG_TABLE_PALICANON_TEMPLET_);
-
-/*
-标题资源表
-app/install/db_update_toc.php 刷库
-*/
-
-define("_FILE_DB_RESRES_INDEX_", _PG_DB_RESRES_INDEX_);
-define("_TABLE_RES_INDEX_",_PG_TABLE_RES_INDEX_);
-
-/*
-巴利语料段落表
-刷库 app/install/db_insert_palitext.php
-更新 app/install/db_update_palitext.php
-*/
-
-define("_FILE_DB_PALITEXT_", _PG_DB_PALITEXT_);
-define("_TABLE_PALI_TEXT_",_PG_TABLE_PALI_TEXT_);
-define("_TABLE_PALI_BOOK_NAME_",_PG_TABLE_PALI_BOOK_NAME_);
-
-#单词表部分
-/*
-以书为单位的单词汇总表
-填充 /app/install/db_insert_bookword_from_csv.php
-*/
-
-define("_FILE_DB_BOOK_WORD_", _PG_DB_BOOK_WORD_);
-define("_TABLE_BOOK_WORD_", _PG_TABLE_BOOK_WORD_);
-
-/*
-单词索引
-/app/install/db_insert_word_from_csv.php
-/app/admin/word_index_weight_refresh.php
-*/
-
-define("_FILE_DB_PALI_INDEX_", _PG_DB_PALI_INDEX_);
-define("_TABLE_WORD_", _PG_TABLE_WORD_);
-
-/*
-92万词
-/app/install/db_insert_wordindex_from_csv.php
-*/
-
-define("_FILE_DB_WORD_INDEX_", _PG_DB_WORD_INDEX_);
-define("_TABLE_WORD_INDEX_", _PG_TABLE_WORD_INDEX_);
-
-//单词索引=92万词+单词索引
-
-//PostgreSQL
-define("_FILE_DB_INDEX_", _PG_DB_INDEX_);
-
-//黑体字数据表
-//sqlite
-define("_FILE_DB_BOLD_", "sqlite:" . _SQLITE_DB_BOLD_);
-define("_TABLE_WORD_BOLD_", _SQLITE_TABLE_WORD_BOLD_);
-
-/*
-单词分析表
-数据迁移: php /deploy/migaration/word_statistics.php
-*/
-
-define("_FILE_DB_STATISTICS_", _PG_DB_STATISTICS_);
-define("_TABLE_WORD_STATISTICS_", _PG_TABLE_WORD_STATISTICS_);
-
-
-/*
-巴利句子表
-数据迁移: php ./deploy/migaration/20211125155700_pali_sent_org.php
-数据迁移: php ./deploy/migaration/20211125165700-pali_sent-upgrade.php
-数据迁移: php ./deploy/migaration/20211126220400-pali_sent_index-upgrade.php
-
-*/
 
-define("_FILE_DB_PALI_SENTENCE_", _PG_DB_PALI_SENTENCE_);
-define("_TABLE_PALI_SENT_", _PG_TABLE_PALI_SENT_);
-define("_TABLE_PALI_SENT_ORG_", _PG_TABLE_PALI_SENT_);
-define("_TABLE_PALI_SENT_INDEX_", _PG_TABLE_PALI_SENT_);
-
-/*
-相似句
-数据迁移 
-php ./deploy/migaration/20211127214800_sent_sim.php
-php ./deploy/migaration/20211127214900-sent_sim_index.php
-redis: 
-php ./app/pali_sent/redis_upgrade_pali_sent.php
-*/
-
-define("_FILE_DB_PALI_SENTENCE_SIM_", _PG_DB_PALI_SENTENCE_SIM_);
-define("_TABLE_SENT_SIM_", _PG_TABLE_SENT_SIM_);
-define("_TABLE_SENT_SIM_INDEX_", _PG_TABLE_SENT_SIM_INDEX_);
+#目录设置,不能更改
+require_once __DIR__."/config.dir.php";
 
 /*
-完成度
-数据迁移
-php ./app/upgrade/upgrade_pali_toc.php
+数据表
 */
+#表设置,此行不能更改
+require_once __DIR__."/config.table.php";
 
-define("_FILE_DB_PALI_TOC_", _PG_DB_PALI_TOC_);
-define("_TABLE_PROGRESS_", _PG_TABLE_PROGRESS_);
-define("_TABLE_PROGRESS_CHAPTER_", _PG_TABLE_PROGRESS_CHAPTER_);
-
-
-//页码对应
-//sqlite
-define("_FILE_DB_PAGE_INDEX_", _SQLITE_DB_PAGE_INDEX_);
-define("_TABLE_PAGE_MATCH_", _SQLITE_TABLE_PAGE_MATCH_);
-define("_TABLE_BOOK_MATCH_", _SQLITE_TABLE_BOOK_MATCH_);
-define("_TABLE_CS6_PARA_", _SQLITE_TABLE_CS6_PARA_);
-define("_TABLE_MY_PAGE_", _SQLITE_TABLE_MY_PAGE_);
-define("_TABLE_PAGE_NUMBER_", _SQLITE_TABLE_PAGE_NUMBER_);
-
-
-# 字典数据表 全部存入redis
-
-
-#参考字典
-define("_FILE_DB_REF_", _SQLITE_DB_REF_);
-define("_TABLE_DICT_REF_", _SQLITE_TABLE_DICT_REF_);
-define("_TABLE_DICT_REF_NAME_", _SQLITE_TABLE_DICT_REF_NAME_);
-
-#参考字典索引
-define("_FILE_DB_REF_INDEX_", _SQLITE_DB_REF_INDEX_);
-define("_TABLE_REF_INDEX_", _SQLITE_TABLE_REF_INDEX_);
-
-
-# 用户数据表
-
-#sqlite
-define("_FILE_DB_USER_WBW_", _SQLITE_DB_USER_WBW_);
-define("_TABLE_USER_WBW_", _SQLITE_TABLE_USER_WBW_);
-define("_TABLE_USER_WBW_BLOCK_", _SQLITE_TABLE_USER_WBW_BLOCK_);
-
-
-# 译文
-#sqlite
-define("_FILE_DB_SENTENCE_", _SQLITE_DB_SENTENCE_);
-define("_TABLE_SENTENCE_", _SQLITE_TABLE_SENTENCE_);
-define("_TABLE_SENTENCE_BLOCK_", _SQLITE_TABLE_SENTENCE_BLOCK_);
-define("_TABLE_SENTENCE_PR_", _SQLITE_TABLE_SENTENCE_PR_);
-
-
-# 译文编辑历史
-#sqlite
-define("_FILE_DB_USER_SENTENCE_HISTORAY_", _SQLITE_DB_USER_SENTENCE_HISTORAY_);
-define("_TABLE_SENTENCE_HISTORAY_", _SQLITE_TABLE_SENTENCE_HISTORAY_);
-
-
-# 逐词解析字典
-# sqlite
-define("_FILE_DB_WBW_", _SQLITE_DB_WBW_);
-define("_TABLE_DICT_WBW_", _SQLITE_TABLE_DICT_WBW_);
-define("_TABLE_DICT_WBW_INDEX_", _SQLITE_TABLE_DICT_WBW_INDEX_);
-
-
-//写入频繁 读取不频繁
-# 用户行为记录
-#sqlite
-define("_FILE_DB_USER_ACTIVE_", _SQLITE_DB_USER_ACTIVE_);
-define("_TABLE_USER_OPERATION_DAILY_", _SQLITE_TABLE_USER_OPERATION_DAILY_);
-define("_TABLE_USER_OPERATION_FRAME_", _SQLITE_TABLE_USER_OPERATION_FRAME_);
-
-
-#sqlite
-define("_FILE_DB_USER_ACTIVE_LOG_", _SQLITE_DB_USER_ACTIVE_LOG_);
-define("_TABLE_USER_OPERATION_LOG_", _SQLITE_TABLE_USER_OPERATION_LOG_);
-
-
-//读取频繁 写入不频繁 
-# 用户账号
-#sqlite
-define("_FILE_DB_USERINFO_", _SQLITE_DB_USERINFO_);
-define("_TABLE_USER_INFO_", _SQLITE_TABLE_USER_INFO_);
-
-
-# 版本风格 
-#sqlite
-define("_FILE_DB_CHANNAL_", _SQLITE_DB_CHANNAL_);
-define("_TABLE_CHANNEL_", _SQLITE_TABLE_CHANNEL_);
-
-
-# 文章 文集
-
-define("_FILE_DB_USER_ARTICLE_", _SQLITE_DB_USER_ARTICLE_);
-define("_TABLE_ARTICLE_", _SQLITE_TABLE_ARTICLE_);
-define("_TABLE_COLLECTION_", _SQLITE_TABLE_COLLECTION_);
-define("_TABLE_ARTICLE_COLLECTION_", _SQLITE_TABLE_ARTICLE_COLLECTION_);
-
-
-
-# 术语
-define("_FILE_DB_TERM_", _SQLITE_DB_TERM_);
-define("_TABLE_TERM_", _SQLITE_TABLE_TERM_);
-
-# 协作
-define("_FILE_DB_USER_SHARE_", _SQLITE_DB_USER_SHARE_);
-define("_TABLE_USER_SHARE_", _SQLITE_TABLE_USER_SHARE_);
-
-# 工作组
-define("_FILE_DB_GROUP_", _SQLITE_DB_GROUP_);
-define("_TABLE_GROUP_INFO_", _SQLITE_TABLE_GROUP_INFO_);
-define("_TABLE_GROUP_MEMBER_", _SQLITE_TABLE_GROUP_MEMBER_);
-
-# 逐词解析文件索引
-define("_FILE_DB_FILEINDEX_", _SQLITE_DB_FILEINDEX_);
-define("_TABLE_FILEINDEX_", _SQLITE_TABLE_FILEINDEX_);
-define("_TABLE_FILEINDEX_POWER_", _SQLITE_TABLE_FILEINDEX_POWER_);
-
-# 课程
-define("_FILE_DB_COURSE_", _SQLITE_DB_COURSE_);
-define("_TABLE_COURSE_",_SQLITE_TABLE_COURSE_);
-define("_TABLE_LESSON_",_SQLITE_TABLE_LESSON_);
-
-# 用户自定义书
-define("_FILE_DB_USER_CUSTOM_BOOK_", _SQLITE_DB_USER_CUSTOM_BOOK_);
-define("_TABLE_CUSTOM_BOOK_", _SQLITE_TABLE_CUSTOM_BOOK_);
-define("_TABLE_CUSTOM_BOOK_SENT_", _SQLITE_TABLE_CUSTOM_BOOK_SENT_);
-
-# 逐词译和译文编辑消息 无需迁移数据
-define("_FILE_DB_MESSAGE_", _SQLITE_DB_MESSAGE_);
-define("_TABLE_MESSAGE_", _SQLITE_TABLE_MESSAGE_);
-
-#点赞
-define("_FILE_DB_LIKE_", _SQLITE_DB_LIKE_);
-define("_TABLE_LIKE_", _SQLITE_TABLE_LIKE_);
-
-
-# 用户字典统计数据 刷库 - 无需迁移数据
-define("_FILE_DB_USER_DICT_", _SQLITE_DB_USER_DICT_);
-define("_TABLE_USER_DICT_", _SQLITE_TABLE_USER_DICT_);
 
 ?>

+ 257 - 0
public/app/table.php → public/app/config.table.php

@@ -1,5 +1,11 @@
 <?php 
 #表名设置,不能更改
+define("_DB_ENGIN_", Database["type"]);
+define("_DB_HOST_", Database["server"]);
+define("_DB_PORT_", Database["port"]);
+define("_DB_NAME_", Database["name"]);
+define("_DB_USERNAME_", Database["user"]);
+define("_DB_PASSWORD_", Database["password"]);
 
 //PostgreSQL
 define("_PDO_DB_DSN_", Database["type"].":host=".Database["server"].";port=".Database["port"].";dbname=".Database["name"].";user=".Database["user"].";password=".Database["password"].";");
@@ -427,4 +433,255 @@ define("_TABLE_PART_", "part");
 //define("_FILE_DB_COMMENTS_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
 define("_FILE_DB_COMMENTS_", "sqlite:" . __DIR__ . "/../tmp/user/comments.db3");
 
+
+
+/*
+  |--------------------
+  |实际使用的表名
+  |---------------------
+*/
+
+
+/*
+前缀:
+Sqlite:  _SQLITE_
+PostgreSql:  _PG_
+*/
+//语料库数据表 pali canon db file 
+/*
+巴利语料模版表
+运行app/install/db_insert_templet.php 刷库
+*/
+
+define("_FILE_DB_PALICANON_TEMPLET_", _PG_DB_PALICANON_TEMPLET_);
+define("_TABLE_PALICANON_TEMPLET_",_PG_TABLE_PALICANON_TEMPLET_);
+
+/*
+标题资源表
+app/install/db_update_toc.php 刷库
+*/
+
+define("_FILE_DB_RESRES_INDEX_", _PG_DB_RESRES_INDEX_);
+define("_TABLE_RES_INDEX_",_PG_TABLE_RES_INDEX_);
+
+/*
+巴利语料段落表
+刷库 app/install/db_insert_palitext.php
+更新 app/install/db_update_palitext.php
+*/
+
+define("_FILE_DB_PALITEXT_", _PG_DB_PALITEXT_);
+define("_TABLE_PALI_TEXT_",_PG_TABLE_PALI_TEXT_);
+define("_TABLE_PALI_BOOK_NAME_",_PG_TABLE_PALI_BOOK_NAME_);
+
+#单词表部分
+/*
+以书为单位的单词汇总表
+填充 /app/install/db_insert_bookword_from_csv.php
+*/
+
+define("_FILE_DB_BOOK_WORD_", _PG_DB_BOOK_WORD_);
+define("_TABLE_BOOK_WORD_", _PG_TABLE_BOOK_WORD_);
+
+/*
+单词索引
+/app/install/db_insert_word_from_csv.php
+/app/admin/word_index_weight_refresh.php
+*/
+
+define("_FILE_DB_PALI_INDEX_", _PG_DB_PALI_INDEX_);
+define("_TABLE_WORD_", _PG_TABLE_WORD_);
+
+/*
+92万词
+/app/install/db_insert_wordindex_from_csv.php
+*/
+
+define("_FILE_DB_WORD_INDEX_", _PG_DB_WORD_INDEX_);
+define("_TABLE_WORD_INDEX_", _PG_TABLE_WORD_INDEX_);
+
+//单词索引=92万词+单词索引
+
+//PostgreSQL
+define("_FILE_DB_INDEX_", _PG_DB_INDEX_);
+
+//黑体字数据表
+//sqlite
+define("_FILE_DB_BOLD_", "sqlite:" . _SQLITE_DB_BOLD_);
+define("_TABLE_WORD_BOLD_", _SQLITE_TABLE_WORD_BOLD_);
+
+/*
+单词分析表
+数据迁移: php /deploy/migaration/word_statistics.php
+*/
+
+define("_FILE_DB_STATISTICS_", _PG_DB_STATISTICS_);
+define("_TABLE_WORD_STATISTICS_", _PG_TABLE_WORD_STATISTICS_);
+
+
+/*
+巴利句子表
+数据迁移: php ./deploy/migaration/20211125155700_pali_sent_org.php
+数据迁移: php ./deploy/migaration/20211125165700-pali_sent-upgrade.php
+数据迁移: php ./deploy/migaration/20211126220400-pali_sent_index-upgrade.php
+
+*/
+
+define("_FILE_DB_PALI_SENTENCE_", _SQLITE_DB_PALI_SENTENCE_);
+define("_TABLE_PALI_SENT_", _SQLITE_TABLE_PALI_SENT_);
+define("_TABLE_PALI_SENT_ORG_", _SQLITE_TABLE_PALI_SENT_ORG_);
+define("_TABLE_PALI_SENT_INDEX_", _SQLITE_TABLE_PALI_SENT_INDEX_);
+
+/*
+相似句
+数据迁移 
+php ./deploy/migaration/20211127214800_sent_sim.php
+php ./deploy/migaration/20211127214900-sent_sim_index.php
+redis: 
+php ./app/pali_sent/redis_upgrade_pali_sent.php
+*/
+
+define("_FILE_DB_PALI_SENTENCE_SIM_", _PG_DB_PALI_SENTENCE_SIM_);
+define("_TABLE_SENT_SIM_", _PG_TABLE_SENT_SIM_);
+define("_TABLE_SENT_SIM_INDEX_", _PG_TABLE_SENT_SIM_INDEX_);
+
+/*
+完成度
+数据迁移
+php ./app/upgrade/upgrade_pali_toc.php
+*/
+
+define("_FILE_DB_PALI_TOC_", _PG_DB_PALI_TOC_);
+define("_TABLE_PROGRESS_", _PG_TABLE_PROGRESS_);
+define("_TABLE_PROGRESS_CHAPTER_", _PG_TABLE_PROGRESS_CHAPTER_);
+
+
+//页码对应
+//sqlite
+define("_FILE_DB_PAGE_INDEX_", _SQLITE_DB_PAGE_INDEX_);
+define("_TABLE_PAGE_MATCH_", _SQLITE_TABLE_PAGE_MATCH_);
+define("_TABLE_BOOK_MATCH_", _SQLITE_TABLE_BOOK_MATCH_);
+define("_TABLE_CS6_PARA_", _SQLITE_TABLE_CS6_PARA_);
+define("_TABLE_MY_PAGE_", _SQLITE_TABLE_MY_PAGE_);
+define("_TABLE_PAGE_NUMBER_", _SQLITE_TABLE_PAGE_NUMBER_);
+
+
+# 字典数据表 全部存入redis
+
+
+#参考字典
+define("_FILE_DB_REF_", _SQLITE_DB_REF_);
+define("_TABLE_DICT_REF_", _SQLITE_TABLE_DICT_REF_);
+define("_TABLE_DICT_REF_NAME_", _SQLITE_TABLE_DICT_REF_NAME_);
+
+#参考字典索引
+define("_FILE_DB_REF_INDEX_", _SQLITE_DB_REF_INDEX_);
+define("_TABLE_REF_INDEX_", _SQLITE_TABLE_REF_INDEX_);
+
+
+# 用户数据表
+
+#sqlite
+define("_FILE_DB_USER_WBW_", _SQLITE_DB_USER_WBW_);
+define("_TABLE_USER_WBW_", _SQLITE_TABLE_USER_WBW_);
+define("_TABLE_USER_WBW_BLOCK_", _SQLITE_TABLE_USER_WBW_BLOCK_);
+
+
+# 译文
+#sqlite
+define("_FILE_DB_SENTENCE_", _SQLITE_DB_SENTENCE_);
+define("_TABLE_SENTENCE_", _SQLITE_TABLE_SENTENCE_);
+define("_TABLE_SENTENCE_BLOCK_", _SQLITE_TABLE_SENTENCE_BLOCK_);
+define("_TABLE_SENTENCE_PR_", _SQLITE_TABLE_SENTENCE_PR_);
+
+
+# 译文编辑历史
+#sqlite
+define("_FILE_DB_USER_SENTENCE_HISTORAY_", _SQLITE_DB_USER_SENTENCE_HISTORAY_);
+define("_TABLE_SENTENCE_HISTORAY_", _SQLITE_TABLE_SENTENCE_HISTORAY_);
+
+
+# 逐词解析字典
+# sqlite
+define("_FILE_DB_WBW_", _SQLITE_DB_WBW_);
+define("_TABLE_DICT_WBW_", _SQLITE_TABLE_DICT_WBW_);
+define("_TABLE_DICT_WBW_INDEX_", _SQLITE_TABLE_DICT_WBW_INDEX_);
+
+
+//写入频繁 读取不频繁
+# 用户行为记录
+#sqlite
+define("_FILE_DB_USER_ACTIVE_", _SQLITE_DB_USER_ACTIVE_);
+define("_TABLE_USER_OPERATION_DAILY_", _SQLITE_TABLE_USER_OPERATION_DAILY_);
+define("_TABLE_USER_OPERATION_FRAME_", _SQLITE_TABLE_USER_OPERATION_FRAME_);
+
+
+#sqlite
+define("_FILE_DB_USER_ACTIVE_LOG_", _SQLITE_DB_USER_ACTIVE_LOG_);
+define("_TABLE_USER_OPERATION_LOG_", _SQLITE_TABLE_USER_OPERATION_LOG_);
+
+
+//读取频繁 写入不频繁 
+# 用户账号
+#sqlite
+define("_FILE_DB_USERINFO_", _SQLITE_DB_USERINFO_);
+define("_TABLE_USER_INFO_", _SQLITE_TABLE_USER_INFO_);
+
+
+# 版本风格 
+#sqlite
+define("_FILE_DB_CHANNAL_", _SQLITE_DB_CHANNAL_);
+define("_TABLE_CHANNEL_", _SQLITE_TABLE_CHANNEL_);
+
+
+# 文章 文集
+
+define("_FILE_DB_USER_ARTICLE_", _SQLITE_DB_USER_ARTICLE_);
+define("_TABLE_ARTICLE_", _SQLITE_TABLE_ARTICLE_);
+define("_TABLE_COLLECTION_", _SQLITE_TABLE_COLLECTION_);
+define("_TABLE_ARTICLE_COLLECTION_", _SQLITE_TABLE_ARTICLE_COLLECTION_);
+
+
+
+# 术语
+define("_FILE_DB_TERM_", _SQLITE_DB_TERM_);
+define("_TABLE_TERM_", _SQLITE_TABLE_TERM_);
+
+# 协作
+define("_FILE_DB_USER_SHARE_", _SQLITE_DB_USER_SHARE_);
+define("_TABLE_USER_SHARE_", _SQLITE_TABLE_USER_SHARE_);
+
+# 工作组
+define("_FILE_DB_GROUP_", _SQLITE_DB_GROUP_);
+define("_TABLE_GROUP_INFO_", _SQLITE_TABLE_GROUP_INFO_);
+define("_TABLE_GROUP_MEMBER_", _SQLITE_TABLE_GROUP_MEMBER_);
+
+# 逐词解析文件索引
+define("_FILE_DB_FILEINDEX_", _SQLITE_DB_FILEINDEX_);
+define("_TABLE_FILEINDEX_", _SQLITE_TABLE_FILEINDEX_);
+define("_TABLE_FILEINDEX_POWER_", _SQLITE_TABLE_FILEINDEX_POWER_);
+
+# 课程
+define("_FILE_DB_COURSE_", _SQLITE_DB_COURSE_);
+define("_TABLE_COURSE_",_SQLITE_TABLE_COURSE_);
+define("_TABLE_LESSON_",_SQLITE_TABLE_LESSON_);
+
+# 用户自定义书
+define("_FILE_DB_USER_CUSTOM_BOOK_", _SQLITE_DB_USER_CUSTOM_BOOK_);
+define("_TABLE_CUSTOM_BOOK_", _SQLITE_TABLE_CUSTOM_BOOK_);
+define("_TABLE_CUSTOM_BOOK_SENT_", _SQLITE_TABLE_CUSTOM_BOOK_SENT_);
+
+# 逐词译和译文编辑消息 无需迁移数据
+define("_FILE_DB_MESSAGE_", _SQLITE_DB_MESSAGE_);
+define("_TABLE_MESSAGE_", _SQLITE_TABLE_MESSAGE_);
+
+#点赞
+define("_FILE_DB_LIKE_", _SQLITE_DB_LIKE_);
+define("_TABLE_LIKE_", _SQLITE_TABLE_LIKE_);
+
+
+# 用户字典统计数据 刷库 - 无需迁移数据
+define("_FILE_DB_USER_DICT_", _SQLITE_DB_USER_DICT_);
+define("_TABLE_USER_DICT_", _SQLITE_TABLE_USER_DICT_);
+
 ?>

+ 2 - 2
public/app/db/user.php

@@ -175,8 +175,8 @@ class User extends Table
 			$ok = $this->_update(["reset_password_token"=>$resetToken],["reset_password_token"],["email"=>$email]);
 			if($ok){
 				#send email
-				$resetLink='https://'.WWW_DOMAIN_NAME."/app/ucenter/reset.php?token=".$resetToken;
-				$resetString=WWW_DOMAIN_NAME."/app/ucenter/reset.php";
+				$resetLink=WWW_SERVER."/app/ucenter/reset.php?token=".$resetToken;
+				$resetString=WWW_SERVER."/app/ucenter/reset.php";
 		
 				// 打开文件并读取数据
 				$irow=0;

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

@@ -19,7 +19,7 @@ if (PHP_SAPI == "cli") {
 		}
         $redis = redis_connect();
         if ($redis == false) {
-            echo "no redis connect\n";
+            fwrite(STDERR,"no redis connect\n") ;
             exit;
 		}
 		
@@ -36,7 +36,7 @@ if (PHP_SAPI == "cli") {
 				runTask($redis,$taskList[$tableNum],$dir);
 			}
 			else{
-				echo "wrong task number task length is ".count($taskList);
+				fwrite(STDERR, "wrong task number task length is ".count($taskList));
 			}
 		}
     }
@@ -48,7 +48,7 @@ function runTask($redis,$task,$dir){
 	foreach ($task->csv as $csv) {
 		$csvfile = $dir."/".$csv;
 		if (($fp = fopen($csvfile, "r")) !== false) {
-			echo "单词表load {$csvfile}\n";
+			fwrite(STDOUT, "单词表load {$csvfile}\n");
 			$row=0;
 			while (($data = fgetcsv($fp)) !== false) {
 				$row++;
@@ -69,20 +69,20 @@ function runTask($redis,$task,$dir){
 					$redis->hSet($task->rediskey,$data1[$task->keycol],json_encode($new, JSON_UNESCAPED_UNICODE));							
 				}
 				else{
-					echo "列不足够:行:{$row} 列:".count($data1)." 数据:{$data} \n";
+					//echo "列不足够:行:{$row} 列:".count($data1)." 数据:{$data} \n";
 				}
 				$count++;
 				if($count%50000==0){
 					sleep(1);
-					echo $count."\n";
+					fwrite(STDOUT, $count."\n");
 				}
 			}
 			fclose($fp);
 			sleep(1);
-			echo "task : {$task->rediskey}:".$redis->hLen($task->rediskey)."\n";
+			fwrite(STDOUT,  "task : {$task->rediskey}:".$redis->hLen($task->rediskey)."\n");
 			
 		} else {
-			echo "can not open csv file. ";
+			fwrite(STDERR,  "can not open csv file. ".PHP_EOL);
 		}	
 	}
 }

+ 4 - 1
public/app/dict/redis_import_term.php

@@ -39,8 +39,11 @@ if (PHP_SAPI == "cli") {
 				$redis->hSet($rediskey,$word["word"],json_encode($redisWord,JSON_UNESCAPED_UNICODE));
 			}
 		}
+		fwrite(STDOUT,  "all done ".$redis->hLen($rediskey).PHP_EOL);
+	}else{
+		fwrite(STDERR,"redis connect is fail".PHP_EOL);
 	}
-	echo "all done ".$redis->hLen($rediskey);
+	
 }
 
 ?>

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

@@ -40,7 +40,7 @@ if (PHP_SAPI == "cli") {
 			}
 		}
 	}
-	echo "all done ".$redis->hLen($rediskey);
+	fwrite(STDOUT,  "all done ".$redis->hLen($rediskey).PHP_EOL);
 }
 
 ?>

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

@@ -5,7 +5,7 @@ require_once __DIR__."/../redis/function.php";
 if (PHP_SAPI == "cli") {
 	$redis = redis_connect();
 	if ($redis != false) {
-		$dbh = new PDO(_DICT_DB_PM_, "", "", array(PDO::ATTR_PERSISTENT => true));
+		$dbh = new PDO(_DICT_DB_PM_, Database["user"], Database["password"], array(PDO::ATTR_PERSISTENT => true));
 		$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 		$query = "SELECT pali,parts from "._TABLE_DICT_PM_." where 1 group by pali";
 		$stmt = $dbh->query($query);
@@ -15,8 +15,11 @@ if (PHP_SAPI == "cli") {
 				$redis->hSet("dict://pm/part",$row["pali"],$row["parts"]);
 			}
 		}
+		fwrite(STDOUT, "all done ".$redis->hLen("dict://pm/part").PHP_EOL);
+	}else{
+		fwrite(STDERR,"redis connect is fail".PHP_EOL);
 	}
-	echo "all done ".$redis->hLen("dict://pm/part");
+	
 }
 
 ?>

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

@@ -16,7 +16,7 @@ if (PHP_SAPI == "cli") {
 			$redis->hSet("dict://ref/has_mean",$row["word"],"1");
 		}
 	}
-	echo "all done ".$redis->hLen("dict://ref/has_mean");
+	fwrite(STDOUT,  "all done ".$redis->hLen("dict://ref/has_mean").PHP_EOL);
 }
 
 ?>

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

@@ -20,14 +20,14 @@ if (PHP_SAPI == "cli") {
 			print_r($languages);
 			foreach ($languages as $thisLang) {
 				# code...
-				echo "runing $thisLang \n";
+				fwrite(STDOUT,  "runing $thisLang \n");
 				$query = "SELECT word,mean from " . _TABLE_DICT_REF_ . " where language = ? group by word";
 				$stmt = $PDO->prepare($query);
         		$stmt->execute(array($thisLang));
 				while($meaning=$stmt->fetch(PDO::FETCH_ASSOC)){
 					$redis->hSet("ref_first_mean://".$thisLang,$meaning["word"],$meaning["mean"]);
 				}
-				echo $thisLang.":".$redis->hLen("ref_first_mean://".$thisLang)."\n";
+				fwrite(STDOUT,  $thisLang.":".$redis->hLen("ref_first_mean://".$thisLang)."\n");
 			}
 
 			$query = "SELECT word,mean from " . _TABLE_DICT_REF_ . " where 1 group by word";
@@ -36,11 +36,11 @@ if (PHP_SAPI == "cli") {
 			while($meaning=$stmt->fetch(PDO::FETCH_ASSOC)){
 				$redis->hSet("ref_first_mean://com",$meaning["word"],$meaning["mean"]);
 			}
-			echo "com:".$redis->hLen("ref_first_mean://com")."\n";
+			fwrite(STDOUT,  "com:".$redis->hLen("ref_first_mean://com")."\n");
 		}
 	}
 	else{
-		echo "no redis server";
+		fwrite(STDERR,  "no redis server");
 	}
 
 }

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

@@ -6,7 +6,7 @@ if (PHP_SAPI == "cli" || isset($_COOKIE["userid"]))
 {
 	$redis = redis_connect();
 	if ($redis != false) {
-		$dbh = new PDO(_DICT_DB_REGULAR_, "", "", array(PDO::ATTR_PERSISTENT => true));
+		$dbh = new PDO(_DICT_DB_REGULAR_, Database["user"], Database["password"], array(PDO::ATTR_PERSISTENT => true));
 		$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 		
 		$query = "select * from (SELECT pali,parts from "._TABLE_DICT_REGULAR_." where 1  order by confidence DESC ) where 1 group by pali";
@@ -15,8 +15,10 @@ if (PHP_SAPI == "cli" || isset($_COOKIE["userid"]))
 			# code...
 			$redis->hSet("dict://regular/part",$row["pali"],$row["parts"]);
 		}
+		fwrite(STDOUT,  "all done ".$redis->hLen("dict://regular/part").PHP_EOL);
+	}else{
+		fwrite(STDERR,"redis connect is fail".PHP_EOL);
 	}
-	echo "all done ".$redis->hLen("dict://regular/part");
 }
 
 ?>

+ 4 - 4
public/app/fts/sql.php

@@ -98,7 +98,7 @@ foreach($scan as $foldername) {
 
     if (is_file($csv_file)) {
       $fileCounter++;      
-      echo "runing : $fileCounter" . PHP_EOL . $csv_file . PHP_EOL;
+      fwrite(STDOUT,"runing : $fileCounter" . PHP_EOL . $csv_file . PHP_EOL);
       // 初始化段落为 0 (没有这种段落)
       $paragraph = 0;
       // 初始化当前段落的黑体字数组
@@ -189,9 +189,9 @@ foreach($scan as $foldername) {
         $dbh_fts->commit();
         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
             $error = $dbh_fts->errorInfo();
-            echo "error - $error[2]".PHP_EOL;
+            fwrite(STDERR, "error - $error[2]".PHP_EOL);
         } else {
-            echo "updata $row recorders.".PHP_EOL;
+            fwrite(STDOUT, "updata $row recorders.".PHP_EOL);
         }	
       }
 
@@ -202,5 +202,5 @@ foreach($scan as $foldername) {
   }
 }
 
-echo "Done. Amitābha \n";
+fwrite(STDOUT, "Done. Amitābha".PHP_EOL);
 ?>

+ 6 - 6
public/app/install/db_insert_bookword_from_csv_cli.php

@@ -11,7 +11,7 @@ set_exception_handler(function($e){
 	exit;
 });
 
-echo "Insert Pali Text To DB".PHP_EOL;
+fwrite(STDOUT, "Insert Pali Text To DB".PHP_EOL);
 
 if ($argc != 3) {
 	echo "help".PHP_EOL;
@@ -53,7 +53,7 @@ if ($_to == 0 || $_to >= $fileNums) {
 }
 
 for ($from=$_from-1; $from < $_to; $from++) { 
-    echo "doing ".($from+1).PHP_EOL;
+    fwrite(STDOUT, "doing ".($from+1).PHP_EOL);
 
     $bookword = array();
 
@@ -82,7 +82,7 @@ for ($from=$_from-1; $from < $_to; $from++) {
     
     if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
         $error = $dbh_word_index->errorInfo();
-        echo "error - $error[2]".PHP_EOL;
+        fwrite(STDERR, "error - $error[2]".PHP_EOL);
         $log .= "$from, $FileName, error, $error[2] \r\n";
     }else{
         // 开始一个事务,关闭自动提交
@@ -102,10 +102,10 @@ for ($from=$_from-1; $from < $_to; $from++) {
         $dbh_word_index->commit();
         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
             $error = $dbh_word_index->errorInfo();
-            echo "error - $error[2]".PHP_EOL;
+            fwrite(STDERR, "error - $error[2]".PHP_EOL);
             $log .= "$from, $FileName, error, $error[2] \r\n";
         } else {
-            echo "updata $count recorders.".PHP_EOL;
+            fwrite(STDOUT, "updata $count recorders.".PHP_EOL);
             $log .= "updata $count recorders.\r\n";
         }	
     }
@@ -116,6 +116,6 @@ for ($from=$_from-1; $from < $_to; $from++) {
     fclose($myLogFile);
     */
 }
-echo "齐活!功德无量!all done!".PHP_EOL;
+fwrite(STDOUT, "齐活!功德无量!all done!".PHP_EOL);
 
 ?>

+ 14 - 12
public/app/install/db_insert_palitext_cli.php

@@ -13,7 +13,7 @@ set_exception_handler(function($e){
 define("_DB_", _PG_DB_PALITEXT_);
 define("_TABLE_",_PG_TABLE_PALI_TEXT_);
 
-echo "Insert Pali Text To DB".PHP_EOL;
+fwrite(STDOUT, "Insert Pali Text To DB".PHP_EOL);
 
 if ($argc != 3) {
 	echo "help".PHP_EOL;
@@ -34,7 +34,7 @@ $to = $_to;
 $filelist = array();
 $fileNums = 0;
 $log = "";
-echo "doing $_from";
+fwrite(STDOUT, "doing $_from".PHP_EOL);
 
 if (($handle = fopen(__DIR__."/filelist.csv", 'r')) !== false) {
     while (($filelist[$fileNums] = fgetcsv($handle, 0, ',')) !== false) {
@@ -69,7 +69,7 @@ for ($from=$_from-1; $from < $to; $from++) {
     $dirXml = $outputFileNameHead . "/";
     
     $xmlfile = $inputFileName;
-    echo "doing:" . $xmlfile . PHP_EOL;
+    fwrite(STDOUT, "doing:" . $xmlfile . PHP_EOL);
     $log = $log . "$from,$FileName,open\r\n";
     
     $arrInserString = array();
@@ -85,9 +85,10 @@ for ($from=$_from-1; $from < $to; $from++) {
     
         }
         fclose($fpPaliText);
-        echo "pali text load:" . $dirPaliTextBase . $xmlfile . PHP_EOL;
+        fwrite(STDOUT, "pali text load:" . $dirPaliTextBase . $xmlfile . PHP_EOL);
     } else {
-        echo "can not pali text file. filename=" . $dirPaliTextBase . $xmlfile;
+        fwrite(STDERR, "can not pali text file. filename=" . $dirPaliTextBase . $xmlfile.PHP_EOL);
+		continue;
     }
     
     $inputRow = 0;
@@ -102,15 +103,16 @@ for ($from=$_from-1; $from < $to; $from++) {
             $inputRow++;
         }
         fclose($fp);
-        echo "单词表load:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL;
+        fwrite(STDOUT, "单词表load:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL);
     } else {
-        echo "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv";
+        fwrite(STDERR, "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL);
         continue;
     }
     
     if (($inputRow - 1) != count($pali_text_array)) {
-        $log = $log . "$from, $FileName,error,文件行数不匹配 inputRow=$inputRow pali_text_array=" . count($pali_text_array) . " \r\n";
-        echo "line count error".PHP_EOL;
+        $log = "$from, $FileName,error,文件行数不匹配 inputRow=$inputRow pali_text_array=" . count($pali_text_array) . PHP_EOL;
+        fwrite(STDERR, $log);
+		continue;
     }
     
     #删除 旧数据
@@ -149,12 +151,12 @@ for ($from=$_from-1; $from < $to; $from++) {
     $dbh->commit();
     if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
         $error = $dbh->errorInfo();
-        echo "error - $error[2]".PHP_EOL;
+        fwrite(STDERR, "error - $error[2]".PHP_EOL);
     
         $log = $log . "$from, $FileName, error, $error[2] \r\n";
     } else {
         $count = count($arrInserString);
-        echo "updata $count recorders.".PHP_EOL;
+        fwrite(STDOUT, "updata $count recorders.".PHP_EOL);
     }
     /*
     $myLogFile = fopen($dirLog . "db_insert_palitext.log", "a");
@@ -162,7 +164,7 @@ for ($from=$_from-1; $from < $to; $from++) {
     fclose($myLogFile);
     */
 }
-echo "all done!".PHP_EOL;
+fwrite(STDOUT, "all done!".PHP_EOL);
 
 
 

+ 11 - 16
public/app/install/db_insert_templet_cli.php

@@ -11,7 +11,7 @@ set_exception_handler(function($e){
 	exit;
 });
 
-echo "Insert templet to DB".PHP_EOL;
+fwrite(STDOUT, "Insert templet to DB".PHP_EOL);
 
 if ($argc != 3) {
 	echo "help".PHP_EOL;
@@ -38,21 +38,21 @@ if (($handle = fopen(__DIR__."/filelist.csv", 'r')) !== false) {
     while (($filelist[] = fgetcsv($handle, 0, ',')) !== false) {
     }
 }
-echo "read file list".PHP_EOL;
+fwrite(STDOUT, "read file list".PHP_EOL);
 
 
 
 $dns = _DB_;
 $dbh = new PDO($dns, _DB_USERNAME_, _DB_PASSWORD_, array(PDO::ATTR_PERSISTENT => true));
 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "db Connectd".PHP_EOL;
+fwrite(STDOUT, "db Connectd".PHP_EOL);
 
 
 for ($from=$_from; $from <=$_to ; $from++) { 
 	# code...
 	
 	$fileSn = $from-1;
-	echo "doing:".$from.PHP_EOL;
+	fwrite(STDOUT, "doing:".$from.PHP_EOL);
 	$FileName = $filelist[$fileSn][1] . ".htm";
 	$fileId = $filelist[$fileSn][0];
 
@@ -84,7 +84,7 @@ for ($from=$_from; $from <=$_to ; $from++) {
 	$g_paliWordCountCounter = 0;
 
 	$xmlfile = $inputFileName;
-	echo "doing:" . $xmlfile . PHP_EOL;
+	fwrite(STDOUT, "doing:" . $xmlfile . PHP_EOL);
 	$log =  "$from,$FileName,open\r\n";
 	//fwrite($myLogFile, $log);
 
@@ -94,7 +94,7 @@ for ($from=$_from; $from <=$_to ; $from++) {
 	$stmt->execute(array($from));
 
 
-	echo "delete ".PHP_EOL;
+	fwrite(STDOUT, "delete ".PHP_EOL);
 
 	$row=0;
 	// 开始一个事务,关闭自动提交
@@ -103,10 +103,8 @@ for ($from=$_from; $from <=$_to ; $from++) {
 	$stmt = $dbh->prepare($query);
 	if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
 		$error = $dbh->errorInfo();
-		echo "error - $error[2]".PHP_EOL;
-
+		fwrite(STDERR, "error - $error[2]".PHP_EOL);
 		$log = "$from, $FileName, error, $error[2] \r\n";
-		//fwrite($myLogFile, $log);
 		exit;
 	} else {
 		// 打开文件并读取数据
@@ -137,9 +135,9 @@ for ($from=$_from; $from <=$_to ; $from++) {
 				$row++;
 			}
 			fclose($fp);
-			echo "word loaded:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL;
+			fwrite(STDOUT, "word loaded:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL);
 		} else {
-			echo "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL;
+			fwrite(STDERR, "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL);
 		}
 	}
 
@@ -147,14 +145,11 @@ for ($from=$_from; $from <=$_to ; $from++) {
 	$dbh->commit();
 	if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
 		$error = $dbh->errorInfo();
-		echo "error - $error[2]".PHP_EOL;
-
+		fwrite(STDERR, "error - $error[2]".PHP_EOL);
 		$log = "$from, $FileName, error, $error[2] \r\n";
-		//fwrite($myLogFile, $log);
 		exit(1);
 	} else {
-		
-		echo "updata $row recorders.".PHP_EOL;
+		fwrite(STDOUT, "updata $row recorders.".PHP_EOL);
 
 	}
 }

+ 5 - 10
public/app/install/db_insert_word_from_csv_cli.php

@@ -14,7 +14,7 @@ set_exception_handler(function($e){
 define("_DB_", _PG_DB_PALI_INDEX_);
 define("_TABLE_", _PG_TABLE_WORD_);
 
-echo "Insert Word To DB".PHP_EOL;
+fwrite(STDOUT, "Insert Word To DB".PHP_EOL);
 
 if ($argc != 3) {
 	echo "help".PHP_EOL;
@@ -53,7 +53,7 @@ if ($_to == 0 || $_to >= $fileNums) {
 }
 
 for ($from=$_from-1; $from < $_to; $from++) { 
-    echo "doing ".($from+1).PHP_EOL;
+    fwrite(STDOUT, "doing ".($from+1).PHP_EOL);
     #删除
     $query = "DELETE FROM "._TABLE_." WHERE book = ?";
     $stmt = $dbh_word_index->prepare($query);
@@ -88,19 +88,14 @@ for ($from=$_from-1; $from < $_to; $from++) {
         $dbh_word_index->commit();
         if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
             $error = $dbh_word_index->errorInfo();
-            echo "error - $error[2] ".PHP_EOL;
+            fwrite(STDERR, "error - $error[2] ".PHP_EOL);
             $log .= "$from, $FileName, error, $error[2] \r\n";
         } else {
-            echo "updata $count recorders.".PHP_EOL;
+            fwrite(STDOUT, "updata $count recorders.".PHP_EOL);
             $log .= "updata $count recorders.\r\n";
         }
     }
-/*
-    $myLogFile = fopen($dirLog . "insert_index.log", "a");
-    fwrite($myLogFile, $log);
-    fclose($myLogFile);
-    */
 }
-    echo "齐活!功德无量!all done!".PHP_EOL;
+fwrite(STDOUT, "齐活!功德无量!all done!".PHP_EOL);
 
 ?>

+ 6 - 6
public/app/install/db_insert_wordindex_from_csv_cli.php

@@ -15,7 +15,7 @@ set_exception_handler(function($e){
 define("_DB_", _PG_DB_WORD_INDEX_);
 define("_TABLE_", _PG_TABLE_WORD_INDEX_);
 
-echo "Insert Word Index To DB".PHP_EOL;
+fwrite(STDOUT, "Insert Word Index To DB".PHP_EOL);
 
 
 $dirLog = _DIR_LOG_ . "/";
@@ -42,7 +42,7 @@ try{
     foreach($scan as $filename) {
         $filename = _DIR_CSV_PALI_CANON_WORD_INDEX_."/".$filename;
         if (is_file($filename)) {
-            echo "doing ".$filename.PHP_EOL;
+            fwrite(STDOUT, "doing ".$filename.PHP_EOL);
             if (($fpoutput = fopen($filename, "r")) !== false) {
 
                 // 开始一个事务,关闭自动提交
@@ -74,20 +74,20 @@ try{
                 $dbh_word_index->commit();
                 if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
                     $error = $dbh_word_index->errorInfo();
-                    echo "error - $error[2]".PHP_EOL;
+                    fwrite(STDERR, "error - $error[2]".PHP_EOL);
                     $log .= "$filename, error, $error[2] \r\n";
                 } else {
-                    echo "updata $count recorders.".PHP_EOL;
+                    fwrite(STDOUT, "updata $count recorders.".PHP_EOL);
                     $log .= "updata $count recorders.\r\n";
                 }
             }else{
-                echo "open file error".PHP_EOL;
+                fwrite(STDERR, "open file error".PHP_EOL);
             }
         
         }
     }
 
-echo "齐活!功德无量!all done!".PHP_EOL;
+	fwrite(STDOUT, "齐活!功德无量!all done!".PHP_EOL);
 
 
 

+ 13 - 17
public/app/install/db_update_palitext_cli.php

@@ -15,7 +15,7 @@ set_exception_handler(function($e){
 define("_DB_PALITEXT_", _PG_DB_PALITEXT_);
 define("_TABLE_",_PG_TABLE_PALI_TEXT_);
 
-echo "Update Pali Text ".PHP_EOL;
+fwrite(STDOUT, "Update Pali Text ".PHP_EOL);
 
 if ($argc != 3) {
 	echo "help".PHP_EOL;
@@ -52,7 +52,7 @@ PDO_Connect(_DB_PALITEXT_,_DB_USERNAME_,_DB_PASSWORD_);
 
 
 for ($from=$_from-1; $from < $to; $from++) { 
-    echo "doing $from".PHP_EOL;
+    fwrite(STDOUT, "doing $from".PHP_EOL);
 
 $FileName = $filelist[$from][1] . ".htm";
 $fileId = $filelist[$from][0];
@@ -72,7 +72,7 @@ $dirPaliTextBase = _DIR_PALI_HTML_ . "/";
 $dirXml = $outputFileNameHead . "/";
 
 $xmlfile = $inputFileName;
-echo "doing:" . $xmlfile . PHP_EOL;
+fwrite(STDOUT, "doing:" . $xmlfile . PHP_EOL);
 
 $log = $log . date("Y-m-d h:i:sa") . ",$from,$FileName,open\r\n";
 
@@ -85,9 +85,9 @@ if (($fpPaliText = fopen($dirPaliTextBase . $xmlfile, "r")) !== false) {
         array_push($pali_text_array, $data);
     }
     fclose($fpPaliText);
-    echo "pali text load:" . $dirPaliTextBase . $xmlfile . PHP_EOL;
+    fwrite(STDOUT, "pali text load:" . $dirPaliTextBase . $xmlfile . PHP_EOL);
 } else {
-    echo "can not pali text file. filename=" . $dirPaliTextBase . $xmlfile;
+    fwrite(STDERR, "can not pali text file. filename=" . $dirPaliTextBase . $xmlfile.PHP_EOL);
 }
 
 // 打开csv文件并读取数据
@@ -101,9 +101,9 @@ if (($fp = fopen(_DIR_PALI_TITLE_ . "/" . ($from + 1) . "_pali.csv", "r")) !== f
         $inputRow++;
     }
     fclose($fp);
-    echo "单词表load:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv". PHP_EOL;
+    fwrite(STDOUT, "单词表load:" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv". PHP_EOL);
 } else {
-    echo "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv";
+    fwrite(STDERR, "can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv" . PHP_EOL);
 }
 
 if ((count($arrInserString)) != count($pali_text_array) - 2) {
@@ -116,7 +116,7 @@ $book = $from + 1;
 
 $query = "SELECT * from "._TABLE_." where book = '$book'  order by paragraph asc";
 $title_data = PDO_FetchAll($query);
-echo "Paragraph Count:" . count($title_data) . " arrInserString:".count($arrInserString). PHP_EOL;
+fwrite(STDOUT, "Paragraph Count:" . count($title_data) . " arrInserString:".count($arrInserString). PHP_EOL);
 
 $paragraph_count = count($title_data);
 
@@ -218,21 +218,17 @@ for ($iPar = 0; $iPar < count($title_data); $iPar++) {
 $PDO->commit();
 if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
     $error = PDO_ErrorInfo();
-    echo "error - $error[2]". PHP_EOL;
+    fwrite(STDERR, "error - $error[2]". PHP_EOL);
 
     $log = $log . "$from, $FileName, error, $error[2] \r\n";
 } else {
     $count = count($title_data);
-    echo "updata $count paragraph info recorders.". PHP_EOL;
-    echo count($paragraph_info) . " Heading". PHP_EOL;
+    fwrite(STDOUT, "updata $count paragraph info recorders.". PHP_EOL);
+    fwrite(STDOUT, count($paragraph_info) . " Heading". PHP_EOL);
 }
 //段落信息结束
-/*
-$myLogFile = fopen(_DIR_LOG_ . "/db_update_palitext.log", "a");
-fwrite($myLogFile, $log);
-fclose($myLogFile);
-*/
+
 }
-echo "all done!".PHP_EOL;
+fwrite(STDOUT, "all done!".PHP_EOL);
 ?>
 

+ 7 - 7
public/app/install/db_update_toc_cli.php

@@ -12,7 +12,7 @@ set_exception_handler(function($e){
 define("_DB_RES_INDEX_", _PG_DB_RESRES_INDEX_);
 define("_TABLE_",_PG_TABLE_RES_INDEX_);
 
-echo "Update toc to res_index".PHP_EOL;
+fwrite(STDOUT, "Update toc to res_index".PHP_EOL);
 
 if ($argc != 4) {
 	echo $argv[0]." help".PHP_EOL;
@@ -34,7 +34,7 @@ $_lang = $argv[3];
 $filelist = array();
 $fileNums = 0;
 $log = "";
-echo "doing $_from".PHP_EOL;
+fwrite(STDOUT, "doing $_from".PHP_EOL);
 
 if (($handle = fopen(__DIR__."/filelist.csv", 'r')) !== false) {
     while (($filelist[$fileNums] = fgetcsv($handle, 0, ',')) !== false) {
@@ -90,9 +90,9 @@ for ($from=$_from-1; $from < $_to; $from++) {
             $inputRow++;
         }
         fclose($fp);
-        echo "res load:" . _DIR_PALI_TITLE_ . "/" . ($from + 1) . "_title.csv".PHP_EOL;
+        fwrite(STDOUT, "res load:" . _DIR_PALI_TITLE_ . "/" . ($from + 1) . "_title.csv".PHP_EOL);
     } else {
-        echo "can not open csv ";
+        fwrite(STDOUT, "can not open csv ".PHP_EOL);
         continue;
     }
     
@@ -155,11 +155,11 @@ for ($from=$_from-1; $from < $_to; $from++) {
     $dbh->commit();
     if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
         $error = $dbh->errorInfo();
-        echo "error - $error[2] ".PHP_EOL;
+        fwrite(STDERR, "error - $error[2] ".PHP_EOL);
         $log = $log . "$from, error, $error[2] \r\n";
     } else {
         $count = count($arrInserString);
-        echo "updata $count title recorders.".PHP_EOL;
+        fwrite(STDOUT, "updata $count title recorders.".PHP_EOL);
     }
     //段落信息结束
     /*
@@ -168,7 +168,7 @@ for ($from=$_from-1; $from < $_to; $from++) {
     fclose($myLogFile);
     */
 }
- echo "<h2>齐活!功德无量!all done!</h2>";
+fwrite(STDOUT, "齐活!功德无量!all done!".PHP_EOL);
 
 
 

+ 3 - 2
public/app/nissaya/nissaya.js

@@ -34,10 +34,11 @@ function render_on_page(params) {
 
 	html += "<div class='img_box' dir='" + params.dir + "' book='" + params.book + "' page='" + params.page + "'>";
 	html += "<div>" + filename + "</div>";
+	let filePath = ASSETS_SERVER + "/nissaya/";
 	if (params.show) {
-		html += "<img class='book_page' src='../../tmp/nissaya/" + filename + "' />";
+		html += "<img class='book_page' src='" + filePath + filename + "' />";
 	} else {
-		html += "<img class='book_page' data-src='../../tmp/nissaya/" + filename + "' />";
+		html += "<img class='book_page' data-src='" + filePath + filename + "' />";
 	}
 	html += "</div>";
 	return html;

+ 6 - 6
public/app/pali_sent/redis_upgrade_pali_sent.php

@@ -21,9 +21,9 @@ if (isset($argv[1])) {
 				$count += $deleted;
 			}
 			
-			echo "delete ok ".$count;			
+			fwrite(STDOUT,"delete ok ".$count.PHP_EOL) ;			
 		}else{
-			echo "redis connect error ".PHP_EOL;			
+			fwrite(STDERR, "redis connect error ".PHP_EOL);			
 
 		}
     }
@@ -50,11 +50,11 @@ if (isset($argv[1])) {
                 $stringSize = 0;  
 			}
 			if($count%10000==0){
-				echo $count . "-".$sent["book"] . "_" . $sent["paragraph"] . "\n";
+				fwrite(STDOUT, $count . "-".$sent["book"] . "_" . $sent["paragraph"] . "\n");
 			}
 			$result = $redis->hSet('pali://sent/' . $sent["book"] . "_" . $sent["paragraph"] . "_" . $sent["begin"] . "_" . $sent["end"], "pali", $sent["html"]);
 			if($result===FALSE){
-				echo "hSet error \n";
+				fwrite(STDERR, "hSet error \n");
 			}
 			$result = $redis->hSet('pali://sent/' . $sent["book"] . "_" . $sent["paragraph"] . "_" . $sent["begin"] . "_" . $sent["end"], "id", $sent["id"]);	
 
@@ -69,8 +69,8 @@ if (isset($argv[1])) {
 			}
 			$result = $redis->hSet('pali://sent/' . $sent["book"] . "_" . $sent["paragraph"] . "_" . $sent["begin"] . "_" . $sent["end"], "sim_count", $pali_sim);			
         }
-        echo "完成 ". count($redis->keys("pali://sent/*"));
+        fwrite(STDOUT, "完成 ". count($redis->keys("pali://sent/*")).PHP_EOL);
     } else {
-        echo "连接redis失败";
+        fwrite(STDERR, "连接redis失败".PHP_EOL);
     }
 }

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

@@ -5,7 +5,8 @@ function redis_connect()
 	try {
 		//code...
 		$redis = new redis();
-		$r_conn = $redis->connect('127.0.0.1', 6379);
+		$r_conn = $redis->connect(Redis["host"], Redis["port"]);
+		$redis->auth(Redis["password"]);
 		if ($r_conn) {
 			return $redis;
 		} else {

+ 3 - 1
public/app/studio/js/index_mydoc.js

@@ -225,7 +225,9 @@ function title_change(id, title) {
 	}
 }
 function share_link_copy_to_clipboard(id) {
-	copy_to_clipboard(WWW_DOMAIN_NAME+"/app/studio/project.php?op=open&doc_id=" + id);
+	let host = location.protocol + '//' + location.host;
+
+	copy_to_clipboard(host+"/app/studio/project.php?op=open&doc_id=" + id);
 }
 function mydoc_file_select(doSelect) {
 	if (doSelect) {

+ 2 - 2
public/app/term/note.js

@@ -288,7 +288,7 @@ function render_read_mode_sent(iterator) {
 		let html = "<span class='tran_sent' lang='" + oneTran.lang + "' channal='" + oneTran.channal + "'>";
 
 		//将绝对链接转换为 用户连接的主机链接
-		oneTran.text = oneTran.text.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+		oneTran.text = oneTran.text.replace(/[A-z]*.wikipali.org/g,location.host);
 
 		html += marked(term_std_str_to_tran(oneTran.text, oneTran.channal, oneTran.editor, oneTran.lang));
 		html += "</span>";
@@ -897,7 +897,7 @@ function render_one_sent_tran_a(iterator, diff = false) {
 	let sid = iterator.book + "-" + iterator.para + "-" + iterator.begin + "-" + iterator.end;
 
 	//将绝对链接转换为 用户连接的主机链接
-	let showText = iterator.text.replace(/[A-z]*.wikipali.org/g,WWW_DOMAIN_NAME);
+	let showText = iterator.text.replace(/[A-z]*.wikipali.org/g,location.host);
 
 	if (iterator.text == "") {
 		if (typeof iterator.channalinfo == "undefined") {

+ 2 - 2
public/app/ucenter/invite.php

@@ -23,8 +23,8 @@ if (PHP_SAPI == "cli") {
 		$invitecode = "invitecode://".$uuid;
 		$redis->set($invitecode,$email);
 		$redis->expire($invitecode,7*20*3600);
-		$SignUpLink=WWW_DOMAIN_PROTOCOL."://".WWW_DOMAIN_NAME . "/app/ucenter/sign_up.php?invite=".$uuid;
-		$SignUpString=WWW_DOMAIN_NAME . "/app/ucenter/sign_up.php";
+		$SignUpLink=WWW_SERVER . "/app/ucenter/sign_up.php?invite=".$uuid;
+		$SignUpString=WWW_SERVER . "/app/ucenter/sign_up.php";
 
 			// 打开文件并读取数据
 		$irow=0;

+ 5 - 3
v1/scripts/migrations/20211125155600_word_statistics.php

@@ -14,10 +14,12 @@ $src_table=_SQLITE_TABLE_WORD_STATISTICS_;#源表名
 $dest_db=_PG_DB_STATISTICS_;#目标数据库
 $dest_table=_PG_TABLE_WORD_STATISTICS_;#目标表名
 
+fwrite(STDOUT,__FILE__." start ".PHP_EOL);
+
 #打开源数据库
 $PDO_SRC = new PDO($src_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_SRC->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open src".PHP_EOL;
+
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
@@ -83,7 +85,7 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
 
 	$count++;
 	if($count%10000==0){
-		echo "finished $count".PHP_EOL;
+		fwrite(STDOUT,"finished $count".PHP_EOL);
 	}
 }
 
@@ -91,7 +93,7 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
 
 $PDO_DEST->commit();
 
-echo "done".PHP_EOL;
+fwrite(STDOUT,"done".PHP_EOL);
 
 
 

+ 6 - 6
v1/scripts/migrations/20211125155700_pali_sent_org.php

@@ -14,16 +14,16 @@ $src_table=_SQLITE_TABLE_PALI_SENT_;#源表名
 $dest_db=_PG_DB_PALI_SENTENCE_;#目标数据库
 $dest_table=_PG_TABLE_PALI_SENT_ORG_;#目标表名
 
-echo "migarate pali_sent_org".PHP_EOL;
+fwrite(STDOUT,"migarate pali_sent_org".PHP_EOL);
 #打开源数据库
 $PDO_SRC = new PDO($src_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_SRC->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open src".PHP_EOL;
+fwrite(STDOUT, "open src".PHP_EOL);
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 #删除目标表中所有数据
 fwrite(STDOUT,"deleting date".PHP_EOL) ;
@@ -39,7 +39,7 @@ fwrite(STDOUT,"deleted date".PHP_EOL) ;
 
 // 开始一个事务,关闭自动提交
 $count = 0;
-echo "begin Transaction".PHP_EOL;
+fwrite(STDOUT, "begin Transaction".PHP_EOL);
 
 $PDO_DEST->beginTransaction();
 
@@ -83,13 +83,13 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
 	}
 	$count++;
 	if($count%10000==0){
-		echo "finished $count".PHP_EOL;
+		fwrite(STDOUT, "finished $count".PHP_EOL);
 	}
 }
 
 // 提交更改
 $PDO_DEST->commit();
-echo "done".PHP_EOL;
+fwrite(STDOUT, "done".PHP_EOL);
 
 
 

+ 6 - 6
v1/scripts/migrations/20211125165700-pali_sent-upgrade.php

@@ -14,16 +14,16 @@ $src_table=_PG_TABLE_PALI_SENT_ORG_;#源表名
 $dest_db=_PG_DB_PALI_SENTENCE_;#目标数据库
 $dest_table=_PG_TABLE_PALI_SENT_;#目标表名
 
-echo "migarate pali_sent_org".PHP_EOL;
+fwrite(STDOUT, "migarate pali_sent_org".PHP_EOL);
 #打开源数据库
 $PDO_SRC = new PDO($src_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_SRC->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open src".PHP_EOL;
+fwrite(STDOUT, "open src".PHP_EOL);
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 
 #删除目标表中所有数据
@@ -40,7 +40,7 @@ fwrite(STDOUT,"deleted date".PHP_EOL) ;
 
 // 开始一个事务,关闭自动提交
 $count = 0;
-echo "begin Transaction".PHP_EOL;
+fwrite(STDOUT, "begin Transaction".PHP_EOL);
 
 $PDO_DEST->beginTransaction();
 
@@ -101,13 +101,13 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
     		
 	$count++;
 	if($count%10000==0){
-		echo "finished $count".PHP_EOL;
+		fwrite(STDOUT, "finished $count".PHP_EOL);
 	}
 }
 
 // 提交更改
 $PDO_DEST->commit();
-echo "done".PHP_EOL;
+fwrite(STDOUT, "done".PHP_EOL);
 
 
 

+ 4 - 4
v1/scripts/migrations/20211126220400-pali_sent_index-upgrade.php

@@ -9,13 +9,13 @@ set_exception_handler(function($e){
 $dest_db = _PG_DB_PALI_SENTENCE_;#目标数据库
 $dest_table = _PG_TABLE_PALI_SENT_INDEX_;#目标表名
 
-echo "migarate pali_sent_index".PHP_EOL;
+fwrite(STDOUT, "migarate pali_sent_index".PHP_EOL);
 
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 #删除目标表中所有数据
 fwrite(STDOUT,"deleting date".PHP_EOL) ;
@@ -38,9 +38,9 @@ try{
 	fwrite(STDERR,"error:".$e->getMessage());
 	exit;
 }
-echo "insert dest".PHP_EOL;
+fwrite(STDOUT, "insert dest".PHP_EOL);
 
-echo "done".PHP_EOL;
+fwrite(STDOUT, "done".PHP_EOL);
 
 
 

+ 6 - 6
v1/scripts/migrations/20211127214800_sent_sim.php

@@ -14,16 +14,16 @@ $src_table = _SQLITE_TABLE_SENT_SIM_;#源表名
 $dest_db = _PG_DB_PALI_SENTENCE_SIM_;#目标数据库
 $dest_table = _PG_TABLE_SENT_SIM_;#目标表名
 
-echo "migarate sent_sim".PHP_EOL;
+fwrite(STDOUT, "migarate sent_sim".PHP_EOL);
 #打开源数据库
 $PDO_SRC = new PDO($src_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_SRC->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open src".PHP_EOL;
+fwrite(STDOUT, "open src".PHP_EOL);
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 #删除目标表中所有数据
 fwrite(STDOUT,"deleting date".PHP_EOL) ;
@@ -36,7 +36,7 @@ fwrite(STDOUT,"deleted date".PHP_EOL) ;
 
 // 开始一个事务,关闭自动提交
 $count = 0;
-echo "begin Transaction".PHP_EOL;
+fwrite(STDOUT, "begin Transaction".PHP_EOL);
 
 $PDO_DEST->beginTransaction();
 
@@ -77,13 +77,13 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
 		
 	$count++;
 	if($count%10000==0){
-		echo "finished $count".PHP_EOL;
+		fwrite(STDOUT, "finished $count".PHP_EOL);
 	}
 }
 
 // 提交更改
 $PDO_DEST->commit();
-echo "done".PHP_EOL;
+fwrite(STDOUT, "done".PHP_EOL);
 
 
 

+ 4 - 4
v1/scripts/migrations/20211127214900-sent_sim_index.php

@@ -11,13 +11,13 @@ set_exception_handler(function($e){
 $dest_db = _PG_DB_PALI_SENTENCE_SIM_;#目标数据库
 $dest_table = _PG_TABLE_SENT_SIM_INDEX_;#目标表名
 
-echo "migarate sent_sim_index".PHP_EOL;
+fwrite(STDOUT, "migarate sent_sim_index".PHP_EOL);
 
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 #删除目标表中所有数据
 fwrite(STDOUT,"deleting date".PHP_EOL) ;
@@ -40,9 +40,9 @@ try{
 	fwrite(STDERR,"error:".$e->getMessage());
 	exit;
 }
-echo "insert dest".PHP_EOL;
+fwrite(STDOUT, "insert dest".PHP_EOL);
 
-echo "done".PHP_EOL;
+fwrite(STDOUT, "done".PHP_EOL);
 
 
 

+ 5 - 5
v1/scripts/migrations/20211202084900_init_pali_serieses.php

@@ -16,18 +16,18 @@ $src_file=_DIR_PALI_TITLE_."/pali_serieses.csv";#源数据
 $dest_db=_PG_DB_PALITEXT_;#目标数据库
 $dest_table=_PG_TABLE_PALI_BOOK_NAME_;#目标表名
 
-echo "migarate pali_serieses".PHP_EOL;
+fwrite(STDOUT, "migarate pali_serieses".PHP_EOL);
 #打开源
 if (($fp = fopen($src_file, "r")) === FALSE) {
-	echo "open $src_file fail".PHP_EOL;
+	fwrite(STDERR, "open $src_file fail".PHP_EOL);
 	exit;
 }
-echo "open src".PHP_EOL;
+fwrite(STDOUT, "open src".PHP_EOL);
 
 #打开目标数据库
 $PDO_DEST = new PDO($dest_db,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
 $PDO_DEST->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-echo "open dest".PHP_EOL;
+fwrite(STDOUT, "open dest".PHP_EOL);
 
 #删除目标表中所有数据
 fwrite(STDOUT,"deleting date".PHP_EOL) ;
@@ -43,7 +43,7 @@ fwrite(STDOUT,"deleted date".PHP_EOL) ;
 
 // 开始一个事务,关闭自动提交
 $count = 0;
-echo "begin Transaction".PHP_EOL;
+fwrite(STDOUT, "begin Transaction".PHP_EOL);
 
 $PDO_DEST->beginTransaction();
 

+ 11 - 19
v1/scripts/upgrade_redis.sh

@@ -1,24 +1,16 @@
 #!/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
+
+php ../../public/app/dict/redis_import_dict.php ../../dicttext/system/system.json
+php ../../public/app/dict/redis_import_dict.php ../../dicttext/rich/rich.json
+php ../../public/app/dict/redis_import_dict.php ../../tmp/dict_text/comp.json
+php ../../public/app/dict/redis_import_term.php
+php ../../public/app/dict/redis_import_user.php
+php ../../public/app/dict/redis_ref_with_mean.php
+php ../../public/app/dict/redis_refresh_first_mean.php
+php ../../public/app/dict/redis_sys_rgl_part.php
+php ../../public/app/dict/redis_pm_part.php
+php ../../public/app/pali_sent/redis_upgrade_pali_sent.php
 
 date