|
|
@@ -162,11 +162,8 @@ function secret_password(int $length = 16): string
|
|
|
/**
|
|
|
* 获取扩展路径
|
|
|
*/
|
|
|
-function extension_path(string $extensionID = ''): string
|
|
|
+function extension_path(string $extensionID): string
|
|
|
{
|
|
|
- if (!$extensionID) {
|
|
|
- return CoreService::$extensionPath;
|
|
|
- }
|
|
|
if (isset(CoreService::$extensionComposerMap[$extensionID]['name'])) {
|
|
|
$extensionName = CoreService::$extensionComposerMap[$extensionID]['name'];
|
|
|
$versions = Plugin::getInstalledSixShopExtensions()['versions'];
|
|
|
@@ -174,7 +171,7 @@ function extension_path(string $extensionID = ''): string
|
|
|
return realpath($versions[$extensionName]['install_path']) . DIRECTORY_SEPARATOR;
|
|
|
}
|
|
|
}
|
|
|
- return CoreService::$extensionPath . $extensionID . DIRECTORY_SEPARATOR;
|
|
|
+ throw new \RuntimeException('Extension not found');
|
|
|
}
|
|
|
|
|
|
|