1212
1313namespace Mine \AppStore \Command ;
1414
15+ use Hyperf \Codec \Json ;
1516use Hyperf \Command \Annotation \Command ;
1617use Hyperf \Stringable \Str ;
1718use Mine \AppStore \Enums \PluginTypeEnum ;
@@ -73,7 +74,7 @@ public function createMineJson(string $path, string $name, PluginTypeEnum $plugi
7374 ],
7475 ];
7576 if ($ pluginType === PluginTypeEnum::Backend || $ pluginType === PluginTypeEnum::Mix) {
76- $ namespace = 'Plugin \\' . Str::studly ($ name );
77+ $ namespace = 'Plugin \\' . ucwords ( str_replace ( ' / ' , '\\' , Str::studly ($ name)) );
7778
7879 $ this ->createInstallScript ($ namespace , $ path );
7980 $ this ->createUninstallScript ($ namespace , $ path );
@@ -82,7 +83,7 @@ public function createMineJson(string $path, string $name, PluginTypeEnum $plugi
8283 $ output ->composer = [
8384 'require ' => [],
8485 'psr-4 ' => [
85- $ namespace . '\\' => 'src ' ,
86+ '\\' . $ namespace . '\\' => 'src ' ,
8687 ],
8788 'installScript ' => $ namespace . '\InstallScript ' ,
8889 'uninstallScript ' => $ namespace . '\UninstallScript ' ,
@@ -96,8 +97,7 @@ public function createMineJson(string $path, string $name, PluginTypeEnum $plugi
9697 ],
9798 ];
9899 }
99-
100- $ output = json_encode ($ output , \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE , 512 );
100+ $ output = Json::encode ($ output );
101101 file_put_contents ($ path . '/mine.json ' , $ output );
102102 $ this ->output ->success (\sprintf ('%s 创建成功 ' , $ path . '/mine.json ' ));
103103 }
0 commit comments