diff --git a/app/Space/Updater.php b/app/Space/Updater.php index 54e292da..45f07c30 100644 --- a/app/Space/Updater.php +++ b/app/Space/Updater.php @@ -33,10 +33,10 @@ class Updater if ($data->success && $data->version) { $extensions = $data->version->extensions; $extensionData = []; - foreach ($extensions as $extension) { - $extensionData[$extension] = phpversion($extension); + foreach (json_decode($extensions) as $extension) { + $extensionData[$extension] = phpversion($extension) ? true : false; } - $extensionData['php'] = phpversion(); + $extensionData['php'. '('.$data->version->minimum_php_version.')'] = version_compare(phpversion(), $data->version->minimum_php_version, ">="); $data->version->extensions = $extensionData; } diff --git a/resources/assets/js/views/settings/UpdateApp.vue b/resources/assets/js/views/settings/UpdateApp.vue index ea517f57..7c7fd9f2 100644 --- a/resources/assets/js/views/settings/UpdateApp.vue +++ b/resources/assets/js/views/settings/UpdateApp.vue @@ -48,15 +48,7 @@ class="col-md-8 p-0" >
-
- {{ i }}({{ minPhpVesrion }}) - - -
-
+
{{ i }} @@ -163,6 +155,15 @@ export default { minPhpVesrion: null, } }, + computed: { + allowToUpdate() { + if (this.requiredExtentions !== null) { + return Object.keys(this.requiredExtentions).every((k) => { + return this.requiredExtentions[k] + }) + } + }, + }, created() { window.addEventListener('beforeunload', (event) => { if (this.isUpdating) { @@ -218,12 +219,7 @@ export default { }, async onUpdateApp() { let path = null - if ( - this.$utils.compareVersion( - this.requiredExtentions.php, - this.minPhpVesrion - ) == -1 - ) { + if (!this.allowToUpdate) { window.toastr['error']( 'Your current configuration does not match the update requirements. Please try again after all the requirements are fulfilled. ' )