@@ -64,32 +64,41 @@ public function handle()
64
64
$ this ->v_1_1 ();
65
65
$ this ->v_1_2 ();
66
66
$ this ->v_2_0 ();
67
- $ result = $ this ->v_3_0 ();
67
+ $ this ->v_3_0 ();
68
+ $ result = $ this ->v_3_1 ();
68
69
break ;
69
70
case 'v1.0 ' :
70
71
$ this ->v_1_1 ();
71
72
$ this ->v_1_2 ();
72
73
$ this ->v_2_0 ();
73
- $ result = $ this ->v_3_0 ();
74
+ $ this ->v_3_0 ();
75
+ $ result = $ this ->v_3_1 ();
74
76
break ;
75
77
case 'v1.1 ' :
76
78
$ this ->v_1_2 ();
77
79
$ this ->v_2_0 ();
78
- $ result = $ this ->v_3_0 ();
80
+ $ this ->v_3_0 ();
81
+ $ result = $ this ->v_3_1 ();
79
82
break ;
80
83
case 'v1.2 ' :
81
84
$ this ->v_2_0 ();
82
- $ result = $ this ->v_3_0 ();
85
+ $ this ->v_3_0 ();
86
+ $ result = $ this ->v_3_1 ();
83
87
break ;
84
88
case 'v2.0 ' :
85
- $ result = $ this ->v_3_0 ();
89
+ $ this ->v_3_0 ();
90
+ $ result = $ this ->v_3_1 ();
91
+ break ;
92
+ case 'v3.0 ' :
93
+ $ result = $ this ->v_3_1 ();
86
94
break ;
87
95
default :
88
96
$ this ->v_1_0 ();
89
97
$ this ->v_1_1 ();
90
98
$ this ->v_1_2 ();
91
99
$ this ->v_2_0 ();
92
- $ result = $ this ->v_3_0 ();
100
+ $ this ->v_3_0 ();
101
+ $ result = $ this ->v_3_1 ();
93
102
}
94
103
Artisan::call ('cache:clear ' );
95
104
$ this ->info ($ result ['status ' ] . ': ' . $ result ['msg ' ]);
@@ -195,7 +204,25 @@ public function v_3_0()
195
204
$ this ->info ('创建完成! ' );
196
205
};
197
206
$ saved = Tool::saveConfig ($ data );
198
- return $ saved ? $ this ->returnStatus ('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json ' .PHP_EOL .' 并移除原数据库 rm -f database/database.sqlite ' ) : $ this ->returnStatus ('更新失败,数据迁移失败,请手动迁移 ' , false );
207
+ return $ saved ? $ this ->returnStatus ('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json ' . PHP_EOL . ' 并移除原数据库 rm -f database/database.sqlite ' ) : $ this ->returnStatus ('更新失败,数据迁移失败,请手动迁移 ' , false );
208
+ }
209
+
210
+ /**
211
+ * @return array
212
+ */
213
+ public function v_3_1 ()
214
+ {
215
+ if (!file_exists (storage_path ('app/config.json ' ))) {
216
+ $ this ->warn ('未检测到配置文件!正在创建配置文件... ' );
217
+ copy (storage_path ('app/example.config.json ' ), storage_path ('app/config.json ' ));
218
+ $ this ->info ('创建完成! ' );
219
+ $ config = Tool::config ();
220
+ } else {
221
+ $ config = Tool::config ();
222
+ $ config = array_merge ($ config , ['app_version ' => 'v3.1 ' ]);
223
+ }
224
+ $ saved = Tool::saveConfig ($ config );
225
+ return $ saved ? $ this ->returnStatus ('更新成功,version=v3.1 ' ) : $ this ->returnStatus ('更新失败,数据迁移失败,请手动迁移 ' , false );
199
226
}
200
227
201
228
/**
0 commit comments