Install.php 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Xiaosongshu\Elasticsearch;
  3. /**
  4. * @purpose 扩展安装器
  5. * @author yanglong
  6. * @time 2025年11月10日18:19:25
  7. */
  8. class Install
  9. {
  10. /**
  11. * 安装配置
  12. * @return void
  13. */
  14. public static function install()
  15. {
  16. echo "安装扩展xiaosongshu/elasticsearch\r\n";
  17. $scriptPath = __DIR__ . '/../scripts/install.php';
  18. if (file_exists($scriptPath)) {
  19. require $scriptPath;
  20. } else {
  21. echo "Install script not found: " . $scriptPath . "\n";
  22. }
  23. }
  24. /**
  25. * 卸载配置
  26. * @return void
  27. */
  28. public static function uninstall()
  29. {
  30. echo "卸载扩展xiaosongshu/elasticsearch\r\n";
  31. $scriptPath = __DIR__ . '/../scripts/uninstall.php';
  32. if (file_exists($scriptPath)) {
  33. require $scriptPath;
  34. } else {
  35. echo "Uninstall script not found: " . $scriptPath . "\n";
  36. }
  37. }
  38. }
  39. //Installer::uninstall();