Jelajahi Sumber

refactor(core): 替换Helper调用为直接函数调用

- 将多个文件中的SixShop\Core\Helper调用替换为对应的直接函数调用
- 移除了对Helper类的依赖引用
- 更新了extension_path函数的调用方式
- 统一了throw_logic_exception函数的使用方式
- 清理了无用的Helper类导入语句
runphp 3 bulan lalu
induk
melakukan
4ea417c093

+ 0 - 1
src/Command/CoreExtensionConfigCommand.php

@@ -3,7 +3,6 @@ declare(strict_types=1);
 
 namespace SixShop\System\Command;
 
-use SixShop\Core\Helper;
 use SixShop\System\ExtensionManager;
 use SixShop\System\Migrate;
 use SixShop\System\Model\ExtensionModel;

+ 0 - 1
src/Command/ExtensionManagementCommand.php

@@ -3,7 +3,6 @@ declare(strict_types=1);
 
 namespace SixShop\System\Command;
 
-use SixShop\Core\Helper;
 use SixShop\System\ExtensionManager;
 use think\console\Command;
 use think\console\Input;

+ 2 - 2
src/Command/ExtensionScaffoldMakeCommand.php

@@ -3,7 +3,7 @@ declare(strict_types=1);
 
 namespace SixShop\System\Command;
 
-use SixShop\Core\Helper;
+use function SixShop\Core\extension_path;
 use think\console\Command;
 use think\console\Input;
 use think\console\input\Argument;
@@ -59,7 +59,7 @@ class ExtensionScaffoldMakeCommand extends Command
             // $withFFI 默认为 false,避免环境未开启 FFI 导致构建失败
         }
 
-        $base = rtrim(Helper::extension_path($module), '/');
+        $base = rtrim(extension_path($module), '/');
         if (is_dir($base) && !$force) {
             $output->error("扩展 {$module} 已存在:{$base},可使用 --force 覆盖写入");
             return 1;

+ 0 - 1
src/Hook/ExtensionStatusHook.php

@@ -6,7 +6,6 @@ namespace SixShop\System\Hook;
 use Closure;
 use SixShop\Core\Attribute\Hook;
 use SixShop\Core\Event\BeforeRegisterRouteEvent;
-use SixShop\Core\Helper;
 use SixShop\Core\Request;
 use SixShop\System\Enum\ExtensionStatusEnum;
 use SixShop\System\ExtensionManager;

+ 0 - 1
src/Hook/GatheringCrontabEventHook.php

@@ -7,7 +7,6 @@ use ReflectionClass;
 use ReflectionMethod;
 use SixShop\Core\Attribute\Cron;
 use SixShop\Core\Attribute\Hook;
-use SixShop\Core\Helper;
 use SixShop\System\Event\CrontabWorkerStartEvent;
 use SixShop\System\Event\GetCronJobsEvent;
 use SixShop\System\ExtensionManager;

+ 3 - 3
src/Service/FrontendDeployService.php

@@ -7,7 +7,7 @@ namespace SixShop\System\Service;
 use RecursiveDirectoryIterator;
 use RecursiveIteratorIterator;
 use RuntimeException;
-use SixShop\Core\Helper;
+use function SixShop\Core\extension_path;
 use SixShop\Core\Service\CoreService;
 use think\facade\Log;
 
@@ -148,8 +148,8 @@ class FrontendDeployService
      */
     private function getPluginPath(string $extensionId): string
     {
-        // 方法 1: 使用 Helper::extension_path()
-        $path = Helper::extension_path($extensionId);
+        // 方法 1: 使用 extension_path()
+        $path = extension_path($extensionId);
         if (is_dir($path)) {
             return $path;
         }