|
|
@@ -210,8 +210,8 @@ class ExtensionManager extends Service
|
|
|
'is_core' => 'in:0,1',
|
|
|
'category' => 'in:' . implode(',', array_keys($categoryMap)),
|
|
|
'description' => 'max:65535',
|
|
|
- 'version' => 'require|max:20',
|
|
|
- 'core_version' => 'require|max:20',
|
|
|
+ 'version' => 'max:20',
|
|
|
+ 'core_version' => 'max:20',
|
|
|
'author' => 'require|max:100',
|
|
|
'email' => 'email|max:100',
|
|
|
'website' => 'url|max:255',
|
|
|
@@ -224,6 +224,12 @@ class ExtensionManager extends Service
|
|
|
if (!isset($extensionInfo['id']) || $extensionInfo['id'] !== $name) {
|
|
|
throw new RuntimeException("{$name}扩展id({$extensionInfo['id']})与目录名不一致");
|
|
|
}
|
|
|
+ if (!isset($extensionInfo['version'])) {
|
|
|
+ $extensionInfo['version'] = '1.0.0';
|
|
|
+ }
|
|
|
+ if (!isset($extensionInfo['core_version'])) {
|
|
|
+ $extensionInfo['core_version'] = '^1.0';
|
|
|
+ }
|
|
|
$extension = ExtensionModel::where(['id' => $name])->append(['status_text'])->findOrEmpty();
|
|
|
if ($extension->isEmpty()) {
|
|
|
$extensionInfo['status'] = 1; // 下载的扩展默认未安装
|