visuddhinanda пре 2 година
родитељ
комит
0db8ef8b8a
81 измењених фајлова са 270 додато и 71 уклоњено
  1. 6 0
      app/Console/Commands/CacheDictPreference.php
  2. 3 0
      app/Console/Commands/CacheWbwPreference.php
  3. 3 0
      app/Console/Commands/ExportChannel.php
  4. 3 0
      app/Console/Commands/ExportChapter.php
  5. 3 0
      app/Console/Commands/ExportChapterIndex.php
  6. 3 0
      app/Console/Commands/ExportCreateDb.php
  7. 3 0
      app/Console/Commands/ExportNissaya.php
  8. 5 2
      app/Console/Commands/ExportOffline.php
  9. 3 0
      app/Console/Commands/ExportPalitext.php
  10. 3 0
      app/Console/Commands/ExportSentence.php
  11. 3 0
      app/Console/Commands/ExportTag.php
  12. 3 0
      app/Console/Commands/ExportTagmap.php
  13. 3 0
      app/Console/Commands/ExportTerm.php
  14. 3 0
      app/Console/Commands/InitCs6sentence.php
  15. 3 0
      app/Console/Commands/InitDependence.php
  16. 3 0
      app/Console/Commands/InitSystemChannel.php
  17. 3 0
      app/Console/Commands/InitSystemDict.php
  18. 14 33
      app/Console/Commands/Install.php
  19. 3 0
      app/Console/Commands/InstallPaliSeries.php
  20. 3 0
      app/Console/Commands/InstallPaliText.php
  21. 13 10
      app/Console/Commands/InstallWbwTemplate.php
  22. 3 0
      app/Console/Commands/InstallWordAll.php
  23. 3 0
      app/Console/Commands/InstallWordBook.php
  24. 3 0
      app/Console/Commands/InstallWordIndex.php
  25. 3 0
      app/Console/Commands/InstallWordStatistics.php
  26. 3 0
      app/Console/Commands/MqDiscussion.php
  27. 3 0
      app/Console/Commands/MqIssues.php
  28. 3 0
      app/Console/Commands/MqPr.php
  29. 3 0
      app/Console/Commands/MqProgress.php
  30. 3 0
      app/Console/Commands/MqTask.php
  31. 3 0
      app/Console/Commands/MqWbwAnalyses.php
  32. 3 0
      app/Console/Commands/RemoveTermCache.php
  33. 3 0
      app/Console/Commands/StatisticsDict.php
  34. 3 0
      app/Console/Commands/StatisticsExp.php
  35. 3 0
      app/Console/Commands/StatisticsNissaya.php
  36. 3 0
      app/Console/Commands/StatisticsWbw.php
  37. 3 0
      app/Console/Commands/TestCaseMan.php
  38. 3 0
      app/Console/Commands/TestJsonToXml.php
  39. 3 1
      app/Console/Commands/TestMdRender.php
  40. 3 1
      app/Console/Commands/TestMq.php
  41. 3 1
      app/Console/Commands/TestMqWorker.php
  42. 3 0
      app/Console/Commands/TestRedis.php
  43. 3 0
      app/Console/Commands/TestSchedule.php
  44. 3 0
      app/Console/Commands/TestSendMail.php
  45. 3 0
      app/Console/Commands/TestTex.php
  46. 3 0
      app/Console/Commands/UpdateRelationTo.php
  47. 3 0
      app/Console/Commands/UpgradeAt20230227.php
  48. 3 0
      app/Console/Commands/UpgradeChapterDynamic.php
  49. 3 0
      app/Console/Commands/UpgradeChapterDynamicWeekly.php
  50. 3 0
      app/Console/Commands/UpgradeCommunityTerm.php
  51. 3 0
      app/Console/Commands/UpgradeCompound.php
  52. 3 21
      app/Console/Commands/UpgradeDaily.php
  53. 3 0
      app/Console/Commands/UpgradeDict.php
  54. 3 0
      app/Console/Commands/UpgradeDictDefaultMeaning.php
  55. 3 0
      app/Console/Commands/UpgradeDictId.php
  56. 4 1
      app/Console/Commands/UpgradeDictSysRegular.php
  57. 3 0
      app/Console/Commands/UpgradeDictSysWbwExtract.php
  58. 3 0
      app/Console/Commands/UpgradeDictVocabulary.php
  59. 3 1
      app/Console/Commands/UpgradeFts.php
  60. 3 0
      app/Console/Commands/UpgradePageNumber.php
  61. 3 0
      app/Console/Commands/UpgradePaliText.php
  62. 3 0
      app/Console/Commands/UpgradePaliTextId.php
  63. 3 0
      app/Console/Commands/UpgradePaliTextTag.php
  64. 3 0
      app/Console/Commands/UpgradePaliToc.php
  65. 3 0
      app/Console/Commands/UpgradePcdBookId.php
  66. 3 0
      app/Console/Commands/UpgradeProgress.php
  67. 3 0
      app/Console/Commands/UpgradeProgressChapter.php
  68. 3 0
      app/Console/Commands/UpgradeQuote.php
  69. 3 0
      app/Console/Commands/UpgradeRelatedParagraph.php
  70. 3 0
      app/Console/Commands/UpgradeSimIndex.php
  71. 3 0
      app/Console/Commands/UpgradeTestData.php
  72. 3 0
      app/Console/Commands/UpgradeVocabulary.php
  73. 3 0
      app/Console/Commands/UpgradeWbwAnalyses.php
  74. 3 0
      app/Console/Commands/UpgradeWbwTemplate.php
  75. 3 0
      app/Console/Commands/UpgradeWeekly.php
  76. 3 0
      app/Console/Commands/UpgradeWordPart.php
  77. 3 0
      app/Console/Commands/UuidViranyani.php
  78. 3 0
      app/Console/Commands/WebHook.php
  79. 3 0
      app/Console/Commands/WebHookArticleNew.php
  80. 3 0
      app/Console/Commands/WebhookDingtalk.php
  81. 3 0
      app/Console/Commands/WebhookWechat.php

+ 6 - 0
app/Console/Commands/CacheDictPreference.php

@@ -41,6 +41,9 @@ class CacheDictPreference extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $prefix = 'dict-preference';
         $words = UserDict::select(['word','language'])
                        ->groupBy(['word','language'])
@@ -60,6 +63,9 @@ class CacheDictPreference extends Command
                 Cache::put("{$prefix}/{$word->word}/{$word->language}",$m[0]);
             }
             $bar->advance();
+            if(\App\Tools\Tools::isStop()){
+                return 0;
+            }
         }
         $bar->finish();
 

+ 3 - 0
app/Console/Commands/CacheWbwPreference.php

@@ -41,6 +41,9 @@ class CacheWbwPreference extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $prefix = 'wbw-preference';
         if($this->option('view')==='all' ||
            $this->option('view')==='my'){

+ 3 - 0
app/Console/Commands/ExportChannel.php

@@ -42,6 +42,9 @@ class ExportChannel extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/ExportChapter.php

@@ -46,6 +46,9 @@ class ExportChapter extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $book = $this->argument('book');
         $para = $this->argument('para');
         $channelId = $this->argument('channel');

+ 3 - 0
app/Console/Commands/ExportChapterIndex.php

@@ -42,6 +42,9 @@ class ExportChapterIndex extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/ExportCreateDb.php

@@ -38,6 +38,9 @@ class ExportCreateDb extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $sqlPath = database_path('export/sentence.sql');
         $exportDir = storage_path('app/public/export/offline');
         $exportFile = $exportDir.'/sentence-'.date("Y-m-d").'.db3';

+ 3 - 0
app/Console/Commands/ExportNissaya.php

@@ -42,6 +42,9 @@ class ExportNissaya extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $nissaya_channel = Channel::where('type','nissaya')->select('uid')->get();
         $channels = [];
         foreach ($nissaya_channel as $key => $value) {

+ 5 - 2
app/Console/Commands/ExportOffline.php

@@ -39,6 +39,9 @@ class ExportOffline extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportDir = storage_path('app/public/export/offline');
         if(!is_dir($exportDir)){
             $res = mkdir($exportDir,0700,true);
@@ -50,7 +53,7 @@ class ExportOffline extends Command
         $exportStop = $exportDir.'/.stop';
         $file = fopen($exportStop,'w');
         fclose($file);
-             
+
         //建表
         $this->info('create db');
         $this->call('export:create.db');
@@ -58,7 +61,7 @@ class ExportOffline extends Command
         //term
         $this->info('term');
         $this->call('export:term');
-        
+
         //导出channel
         $this->info('channel');
         $this->call('export:channel');

+ 3 - 0
app/Console/Commands/ExportPalitext.php

@@ -40,6 +40,9 @@ class ExportPalitext extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/ExportSentence.php

@@ -44,6 +44,9 @@ class ExportSentence extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $channels = [];
         $channel_id = $this->option('channel');
         if($channel_id){

+ 3 - 0
app/Console/Commands/ExportTag.php

@@ -40,6 +40,9 @@ class ExportTag extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/ExportTagmap.php

@@ -40,6 +40,9 @@ class ExportTagmap extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/ExportTerm.php

@@ -40,6 +40,9 @@ class ExportTerm extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exportFile = storage_path('app/public/export/offline/sentence-'.date("Y-m-d").'.db3');
         $dbh = new \PDO('sqlite:'.$exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);

+ 3 - 0
app/Console/Commands/InitCs6sentence.php

@@ -43,6 +43,9 @@ class InitCs6sentence extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$start = time();
         $channelId = ChannelApi::getSysChannel('_System_Pali_VRI_');
         if($channelId === false){

+ 3 - 0
app/Console/Commands/InitDependence.php

@@ -39,6 +39,9 @@ class InitDependence extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		#克隆依赖的数据仓库到本地
 		$depDir = $this->info(config("mint.path.dependence"));
 		foreach ($this->info(config("mint.dependence")) as $key => $value) {

+ 3 - 0
app/Console/Commands/InitSystemChannel.php

@@ -101,6 +101,9 @@ class InitSystemChannel extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info("start");
         foreach ($this->channels as $key => $value) {
             # code...

+ 3 - 0
app/Console/Commands/InitSystemDict.php

@@ -72,6 +72,9 @@ class InitSystemDict extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info("start");
         foreach ($this->dictionary as $key => $value) {
             # code...

+ 14 - 33
app/Console/Commands/Install.php

@@ -35,49 +35,30 @@ class Install extends Command
      *
      * @return int
      */
-	/*
-	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
-	*/
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$isTest = $this->option('test');
 		if($isTest){
 			$this->call('install:wbwtemplate', ['from' => 1]);
 		}else{
-			$this->call('install:wbwtemplate');	
-			$this->call('install:palitext');	
-			$this->call('install:wordbook');	
-			$this->call('install:wordall');	
+			$this->call('install:wbwtemplate');
+			$this->call('install:palitext');
+			$this->call('install:wordbook');
+			$this->call('install:wordall');
 			$this->call('install:wordindex');
 
-			$this->call('upgrade:palitext');	
-			$this->call('upgrade:palitoc',['lang'=>'pali']);	
-			$this->call('upgrade:palitoc',['lang'=>'zh-hans']);	
-			$this->call('upgrade:palitoc',['lang'=>'zh-hant']);	
+			$this->call('upgrade:palitext');
+			$this->call('upgrade:palitoc',['lang'=>'pali']);
+			$this->call('upgrade:palitoc',['lang'=>'zh-hans']);
+			$this->call('upgrade:palitoc',['lang'=>'zh-hant']);
+
+			$this->call('install:paliseries');
+			$this->call('install:wordstatistics');
 
-			$this->call('install:paliseries');	
-			$this->call('install:wordstatistics');	
-			
 		}
 
         return 0;

+ 3 - 0
app/Console/Commands/InstallPaliSeries.php

@@ -40,6 +40,9 @@ class InstallPaliSeries extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("upgrade pali serieses");
 		$startTime = time();
 

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

@@ -40,6 +40,9 @@ class InstallPaliText extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("instert pali text");
 		$startTime = time();
 

+ 13 - 10
app/Console/Commands/InstallWbwTemplate.php

@@ -40,6 +40,9 @@ class InstallWbwTemplate extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("instert wbw template");
 
 
@@ -61,22 +64,22 @@ class InstallWbwTemplate extends Command
 		}
 		$bar = $this->output->createProgressBar($_to-$_from+1);
 
-		for ($from=$_from; $from <=$_to ; $from++) { 
+		for ($from=$_from; $from <=$_to ; $from++) {
 			# code...
-			
+
 			$fileSn = $from-1;
 			$outputFileNameHead = $filelist[$fileSn][1];
-	
+
 			$dirXmlBase = public_path('/tmp/palicsv') . "/";
 			$dirXml = $outputFileNameHead . "/";
-		
-		
+
+
 			#删除目标数据库中数据
 			WbwTemplate::where('book', $from)->delete();
 
 
 			// 打开文件并读取数据
-			
+
 			if (($GLOBALS["fp"] = fopen($dirXmlBase . $dirXml . $outputFileNameHead . ".csv", "r")) !== false) {
 				$GLOBALS["row"]=0;
 				DB::transaction(function () {
@@ -95,7 +98,7 @@ class InstallWbwTemplate extends Command
 							'type'=>$data[6],
 							'gramma'=>$data[7],
 							'part'=>$data[10],
-							'style'=>$data[15]	
+							'style'=>$data[15]
 						];
 						WbwTemplate::insert($params);
 					}
@@ -105,11 +108,11 @@ class InstallWbwTemplate extends Command
 				$this->error("can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL) ;
 				Log::error("can not open csv file. filename=" . $dirXmlBase . $dirXml . $outputFileNameHead . ".csv".PHP_EOL) ;
 			}
-			
+
 			$bar->advance();
 		}
 		$bar->finish();
         return 0;
-    
+
 	}
-}
+}

+ 3 - 0
app/Console/Commands/InstallWordAll.php

@@ -40,6 +40,9 @@ class InstallWordAll extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$startTime = time();
 
 		$this->info("instert word in palibook ");

+ 3 - 0
app/Console/Commands/InstallWordBook.php

@@ -40,6 +40,9 @@ class InstallWordBook extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$startTime = time();
 
 		$this->info("instert word in palibook ");

+ 3 - 0
app/Console/Commands/InstallWordIndex.php

@@ -40,6 +40,9 @@ class InstallWordIndex extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$startTime = time();
 
 		$info = "instert word in palibook ";

+ 3 - 0
app/Console/Commands/InstallWordStatistics.php

@@ -40,6 +40,9 @@ class InstallWordStatistics extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$startTime = time();
 
 		$info = "instert wordstatistics ";

+ 3 - 0
app/Console/Commands/MqDiscussion.php

@@ -46,6 +46,9 @@ class MqDiscussion extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'discussion';
         $this->info(" [*] Waiting for {$queue}. To exit press CTRL+C");

+ 3 - 0
app/Console/Commands/MqIssues.php

@@ -38,6 +38,9 @@ class MqIssues extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'issues';
         $this->info(" [*] Waiting for {$queue}. To exit press CTRL+C");

+ 3 - 0
app/Console/Commands/MqPr.php

@@ -43,6 +43,9 @@ class MqPr extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'suggestion';
         $this->info(" [*] Waiting for {$queue}. To exit press CTRL+C");

+ 3 - 0
app/Console/Commands/MqProgress.php

@@ -38,6 +38,9 @@ class MqProgress extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'progress';
         $this->info(" [*] Waiting for {$queue}. To exit press CTRL+C");

+ 3 - 0
app/Console/Commands/MqTask.php

@@ -39,6 +39,9 @@ class MqTask extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info('env='.env("RABBITMQ_HOST"));
         $this->info('config='.config("queue.connections.rabbitmq.host"));
         $exchange = 'router';

+ 3 - 0
app/Console/Commands/MqWbwAnalyses.php

@@ -38,6 +38,9 @@ class MqWbwAnalyses extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'wbw-analyses';
         $this->info(" [*] Waiting for {$queue}. To exit press CTRL+C");

+ 3 - 0
app/Console/Commands/RemoveTermCache.php

@@ -40,6 +40,9 @@ class RemoveTermCache extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $word = $this->argument('word');
         $channels = Channel::select('uid')->get();
         if(empty($word)){

+ 3 - 0
app/Console/Commands/StatisticsDict.php

@@ -40,6 +40,9 @@ class StatisticsDict extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $file = "public/statistics/lookup-monthly.csv";
         Storage::disk('local')->put($file, "");
         #按月获取数据

+ 3 - 0
app/Console/Commands/StatisticsExp.php

@@ -40,6 +40,9 @@ class StatisticsExp extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $file = "public/statistics/exp-monthly.csv";
         Storage::disk('local')->put($file, "");
         #按月获取数据

+ 3 - 0
app/Console/Commands/StatisticsNissaya.php

@@ -41,6 +41,9 @@ class StatisticsNissaya extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $nissaya_channel = Channel::where('type','nissaya')->select('uid')->get();
         $this->info('channel:'.count($nissaya_channel));
         $maxDay = 360;

+ 3 - 0
app/Console/Commands/StatisticsWbw.php

@@ -40,6 +40,9 @@ class StatisticsWbw extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $file = "public/statistics/wbw-monthly.csv";
         Storage::disk('local')->put($file, "");
         #按月获取数据

+ 3 - 0
app/Console/Commands/TestCaseMan.php

@@ -40,6 +40,9 @@ class TestCaseMan extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$caseMan = new CaseMan();
         $case = $caseMan->Declension($this->argument('word'),'.n:base.','.nt.',0.5);
         print_r($case);

+ 3 - 0
app/Console/Commands/TestJsonToXml.php

@@ -38,6 +38,9 @@ class TestJsonToXml extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $array = [
             'pali'=>['status'=>'7','value'=>'bārāṇasiyaṃ'],
             'real'=>['status'=>'7','value'=>'bārāṇasiyaṃ'],

+ 3 - 1
app/Console/Commands/TestMdRender.php

@@ -40,8 +40,10 @@ class TestMdRender extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         Log::info('md render start item='.$this->argument('item'));
-
         $data = array();
         $data['bold'] = <<<md
         **三十位** 经

+ 3 - 1
app/Console/Commands/TestMq.php

@@ -42,7 +42,9 @@ class TestMq extends Command
      */
     public function handle()
     {
-
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		Mq::publish('hello',['hello world']);
         $discussion = $this->option('discussion');
         if($discussion && Str::isUuid($discussion)){

+ 3 - 1
app/Console/Commands/TestMqWorker.php

@@ -39,10 +39,12 @@ class TestMqWorker extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $exchange = 'router';
         $queue = 'hello';
         $consumerTag = 'consumer';
-
         $connection = new AMQPStreamConnection(config("queue.connections.rabbitmq.host"),
                                             config("queue.connections.rabbitmq.port"),
                                             config("queue.connections.rabbitmq.user"),

+ 3 - 0
app/Console/Commands/TestRedis.php

@@ -40,6 +40,9 @@ class TestRedis extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$value='this is a test';
 		$this->info("test redis start");
         $remember = Cache::store('redis')->remember('dd',10,function(){

+ 3 - 0
app/Console/Commands/TestSchedule.php

@@ -38,6 +38,9 @@ class TestSchedule extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         Log::info('schedule test start');
         $this->info('schedule test start');
         return 0;

+ 3 - 0
app/Console/Commands/TestSendMail.php

@@ -40,6 +40,9 @@ class TestSendMail extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $uuid = Str::uuid();
         Mail::to("visuddhinanda@gmail.com")
             ->send(new InviteMail($uuid,'en'));

+ 3 - 0
app/Console/Commands/TestTex.php

@@ -39,6 +39,9 @@ class TestTex extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $tex = array();
         $content = <<<'EOF'
 % 导言区

+ 3 - 0
app/Console/Commands/UpdateRelationTo.php

@@ -38,6 +38,9 @@ class UpdateRelationTo extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $count=0;
         $all=0;
         foreach (Relation::select(['id','to'])->cursor() as $relation) {

+ 3 - 0
app/Console/Commands/UpgradeAt20230227.php

@@ -37,6 +37,9 @@ class UpgradeAt20230227 extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->call('init:system.channel');
         $this->call('init:system.dict');
         $this->call('upgrade:dict');

+ 3 - 0
app/Console/Commands/UpgradeChapterDynamic.php

@@ -42,6 +42,9 @@ class UpgradeChapterDynamic extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info('upgrade:chapterdynamic start.');
 
         $startAt = time();

+ 3 - 0
app/Console/Commands/UpgradeChapterDynamicWeekly.php

@@ -43,6 +43,9 @@ class UpgradeChapterDynamicWeekly extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info('upgrade:chapter.dynamic.weekly start.');
 
         $startAt = time();

+ 3 - 0
app/Console/Commands/UpgradeCommunityTerm.php

@@ -44,6 +44,9 @@ class UpgradeCommunityTerm extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $lang = strtolower($this->argument('lang'));
         $langFamily = explode('-',$lang)[0];
         $localTerm = ChannelApi::getSysChannel(

+ 3 - 0
app/Console/Commands/UpgradeCompound.php

@@ -46,6 +46,9 @@ class UpgradeCompound extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         if(file_exists(base_path('.stop'))){
             $this->info('.stop exists');
             return 0;

+ 3 - 21
app/Console/Commands/UpgradeDaily.php

@@ -40,6 +40,9 @@ class UpgradeDaily extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         Log::info('daily task start');
         $start = time();
 		if(app()->isLocal()==false){
@@ -52,10 +55,6 @@ class UpgradeDaily extends Command
 		}
         Log::info('wikipali: 每日统计后台任务开始执行');
         $message = "wikipali: 每日统计后台任务执行完毕。";
-        //巴利原文段落库目录结构改变时运行
-        //$this->call('upgrade:palitext');
-        #巴利段落标签
-        //$this->call('upgrade:palitexttag');
 
         //更新单词首选意思
         $this->call('upgrade:dict.default.meaning');
@@ -71,23 +70,6 @@ class UpgradeDaily extends Command
         $currTime = time();
         Log::info('社区术语表完毕');
 
-        /*
-        #译文进度
-        $this->call('upgrade:progress');
-        $time = time()-$currTime;
-        $message .= "progress:{$time}; ";
-        $currTime = time();
-
-        $this->call('upgrade:progress.chapter');
-        $time = time()-$currTime;
-        $message .= "progress.chapter:{$time}; ";
-        $currTime = time();
-
-        # 逐词译数据库分析
-        $this->call('upgrade:wbw.analyses');
-        $time = time()-$currTime;
-        $message .= "wbw.analyses:{$time}; ";
-*/
         # 导出离线数据
         $this->call('export:offline',['format'=>'lzma']);
         $time = time()-$currTime;

+ 3 - 0
app/Console/Commands/UpgradeDict.php

@@ -215,6 +215,9 @@ class UpgradeDict extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("upgrade dict start");
 		$this->scandict(config("mint.path.dict_text"));
 		$this->info("upgrade dict done");

+ 3 - 0
app/Console/Commands/UpgradeDictDefaultMeaning.php

@@ -87,6 +87,9 @@ class UpgradeDictDefaultMeaning extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $_word = $this->argument('word');
         # 获取字典中所有的语言
         $langInDict = UserDict::select('language')->groupBy('language')->get();

+ 3 - 0
app/Console/Commands/UpgradeDictId.php

@@ -39,6 +39,9 @@ class UpgradeDictId extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info($this->description);
         $user_dict_id = DictApi::getSysDict('community');
         if($user_dict_id){

+ 4 - 1
app/Console/Commands/UpgradeDictSysRegular.php

@@ -19,7 +19,7 @@ class UpgradeDictSysRegular extends Command
 {
     /**
      * The name and signature of the console command.
-     *
+     * php artisan upgrade:regular
      * @var string
      */
     protected $signature = 'upgrade:regular {word?} {--debug}';
@@ -47,6 +47,9 @@ class UpgradeDictSysRegular extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $dict_id = DictApi::getSysDict('system_regular');
         if(!$dict_id){
             $this->error('没有找到 system_regular 字典');

+ 3 - 0
app/Console/Commands/UpgradeDictSysWbwExtract.php

@@ -43,6 +43,9 @@ class UpgradeDictSysWbwExtract extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $user_dict_id = DictApi::getSysDict('community');
         if(!$user_dict_id){
             $this->error('没有找到 community 字典');

+ 3 - 0
app/Console/Commands/UpgradeDictVocabulary.php

@@ -40,6 +40,9 @@ class UpgradeDictVocabulary extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $words = UserDict::where('source','_PAPER_')->selectRaw('word,count(*)')->groupBy('word')->cursor();
 
 		$bar = $this->output->createProgressBar(230000);

+ 3 - 1
app/Console/Commands/UpgradeFts.php

@@ -42,7 +42,9 @@ class UpgradeFts extends Command
      */
     public function handle()
     {
-
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         if($this->option('content')){
             if(!empty($this->argument('para'))){
                 $para = explode('-',$this->argument('para'));

+ 3 - 0
app/Console/Commands/UpgradePageNumber.php

@@ -39,6 +39,9 @@ class UpgradePageNumber extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $table = WbwTemplate::where('type','.ctl.')->orderBy('book')->orderBy('paragraph')->cursor();
         $pageHead = ['M','P','T','V','O'];
         $bar = $this->output->createProgressBar(WbwTemplate::where('type','.ctl.')->count());

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

@@ -44,6 +44,9 @@ class UpgradePaliText extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("upgrade pali text");
 		$startTime = time();
 

+ 3 - 0
app/Console/Commands/UpgradePaliTextId.php

@@ -40,6 +40,9 @@ class UpgradePaliTextId extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info("upgrade pali text uuid");
         $startTime = time();
 

+ 3 - 0
app/Console/Commands/UpgradePaliTextTag.php

@@ -41,6 +41,9 @@ class UpgradePaliTextTag extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info("upgrade pali text tag");
         $startTime = time();
 

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

@@ -41,6 +41,9 @@ class UpgradePaliToc extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("upgrade pali text");
 		$startTime = time();
 

+ 3 - 0
app/Console/Commands/UpgradePcdBookId.php

@@ -40,6 +40,9 @@ class UpgradePcdBookId extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $table = $this->option('table');
         $bookTitles = BookTitle::orderBy('sn')->get();
         $bar = $this->output->createProgressBar(count($bookTitles));

+ 3 - 0
app/Console/Commands/UpgradeProgress.php

@@ -42,6 +42,9 @@ class UpgradeProgress extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info('upgrade:progress start');
 		$startTime = time();
         $book = $this->option('book');

+ 3 - 0
app/Console/Commands/UpgradeProgressChapter.php

@@ -46,6 +46,9 @@ class UpgradeProgressChapter extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$this->info("upgrade:progresschapter start.");
 		$startTime = time();
         $book = $this->option('book');

+ 3 - 0
app/Console/Commands/UpgradeQuote.php

@@ -42,6 +42,9 @@ class UpgradeQuote extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $start = time();
         $channelId = ChannelApi::getSysChannel('_System_Quote_');
         if($channelId===false){

+ 3 - 0
app/Console/Commands/UpgradeRelatedParagraph.php

@@ -43,6 +43,9 @@ class UpgradeRelatedParagraph extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->info("upgrade related.paragraph");
 		$startTime = time();
         #删除目标数据库中数据

+ 3 - 0
app/Console/Commands/UpgradeSimIndex.php

@@ -40,6 +40,9 @@ class UpgradeSimIndex extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $result = DB::select('select count(*) from (select sent1 from sent_sims where sim>0.5  group by sent1) T');
         $bar = $this->output->createProgressBar($result[0]->count);
         foreach (SentSim::selectRaw('sent1,count(*)')

+ 3 - 0
app/Console/Commands/UpgradeTestData.php

@@ -39,6 +39,9 @@ class UpgradeTestData extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $this->call('init:cs6sentence',[$this->argument('book')]);
         $this->call('upgrade:wbw.template',[$this->argument('book')]);
         $this->call('upgrade:chapter.dynamic.weekly',["--book"=>$this->argument('book'),"--offset"=>300]);

+ 3 - 0
app/Console/Commands/UpgradeVocabulary.php

@@ -40,6 +40,9 @@ class UpgradeVocabulary extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$words = UserDict::select('word')->groupBy('word')->cursor();
 		$count=0;
 		foreach ($words as $word) {

+ 3 - 0
app/Console/Commands/UpgradeWbwAnalyses.php

@@ -40,6 +40,9 @@ class UpgradeWbwAnalyses extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		$startAt = time();
 		$this->info("upgrade:wbwanalyses start");
 

+ 3 - 0
app/Console/Commands/UpgradeWbwTemplate.php

@@ -42,6 +42,9 @@ class UpgradeWbwTemplate extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $start = time();
 		$pali = new PaliSentence;
 		if(!empty($this->argument('book'))){

+ 3 - 0
app/Console/Commands/UpgradeWeekly.php

@@ -37,6 +37,9 @@ class UpgradeWeekly extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         #译文进度
         $this->call('upgrade:progress');
         $time = time()-$currTime;

+ 3 - 0
app/Console/Commands/UpgradeWordPart.php

@@ -42,6 +42,9 @@ class UpgradeWordPart extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $delete = WordPart::where('id','>',0)->delete();
         #载入纸质词典数据
         $paper = UserDict::selectRaw('word,count(*)')->where("source",'_PAPER_')->groupBy('word')->cursor();

+ 3 - 0
app/Console/Commands/UuidViranyani.php

@@ -50,6 +50,9 @@ class UuidViranyani extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $old = "C1AB2ABF-EAA8-4EEF-B4D9-3854321852B4";
 		$result = DB::select('UPDATE "articles" set "owner"=? where "owner"=? ',[strtolower($old),$old]);
 		$result = DB::select('UPDATE "channels" set "owner_uid"=? where "owner_uid"=? ',[strtolower($old),$old]);

+ 3 - 0
app/Console/Commands/WebHook.php

@@ -42,6 +42,9 @@ class WebHook extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		switch ($this->argument('listener')) {
 			case 'weixin':
 				break;

+ 3 - 0
app/Console/Commands/WebHookArticleNew.php

@@ -38,6 +38,9 @@ class WebHookArticleNew extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
 		# 获取最新文章数据
 		$url = config('app.url')."/api/v2/progress?view=chapter&channel_type=translation";
 

+ 3 - 0
app/Console/Commands/WebhookDingtalk.php

@@ -39,6 +39,9 @@ class WebhookDingtalk extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $url = $this->argument('url');
         $param = ["markdown"=> [
                         "title"=> $this->argument('title'),

+ 3 - 0
app/Console/Commands/WebhookWechat.php

@@ -39,6 +39,9 @@ class WebhookWechat extends Command
      */
     public function handle()
     {
+        if(\App\Tools\Tools::isStop()){
+            return 0;
+        }
         $url = $this->argument('url');
         $title =  $this->argument('title');
         $content = $this->argument('message');