Install.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. class Install extends Command
  5. {
  6. /**
  7. * The name and signature of the console command.
  8. *
  9. * @var string
  10. */
  11. protected $signature = 'install {--test}';
  12. /**
  13. * The console command description.
  14. *
  15. * @var string
  16. */
  17. protected $description = 'install new host';
  18. /**
  19. * Create a new command instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. }
  27. /**
  28. * Execute the console command.
  29. *
  30. * @return int
  31. */
  32. public function handle()
  33. {
  34. if(\App\Tools\Tools::isStop()){
  35. return 0;
  36. }
  37. $isTest = $this->option('test');
  38. if($isTest){
  39. $this->call('install:wbwtemplate', ['from' => 1]);
  40. }else{
  41. $this->call('install:wbwtemplate');
  42. $this->call('install:palitext');
  43. $this->call('install:wordbook');
  44. $this->call('install:wordall');
  45. $this->call('install:wordindex');
  46. $this->call('upgrade:palitext');
  47. $this->call('upgrade:palitoc',['lang'=>'pali']);
  48. $this->call('upgrade:palitoc',['lang'=>'zh-hans']);
  49. $this->call('upgrade:palitoc',['lang'=>'zh-hant']);
  50. $this->call('install:paliseries');
  51. $this->call('install:wordstatistics');
  52. }
  53. return 0;
  54. }
  55. }