From a7ade71c062db45294a2beb9a5d2596e2428100e Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 17:01:01 +0200 Subject: [PATCH] Update on v4.0.0-alpha1 (changes towards the next release) Here's an update on the current version, which includes changes towards the next release still in development. --- README.md | 2 +- admin/README.txt | 2 +- .../Extension/JoomlaFive/InstallScript.php | 21 +++++++++++++++++++ .../Extension/JoomlaFour/InstallScript.php | 21 +++++++++++++++++++ .../Extension/JoomlaThree/InstallScript.php | 21 +++++++++++++++++++ 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3386f9984..2d369d329 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ TODO + *Version*: 4.0.0-alpha1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **725507** ++ *Line count*: **725229** + *Field count*: **2078** + *File count*: **5115** + *Folder count*: **518** diff --git a/admin/README.txt b/admin/README.txt index 3386f9984..2d369d329 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -148,7 +148,7 @@ TODO + *Version*: 4.0.0-alpha1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **725507** ++ *Line count*: **725229** + *Field count*: **2078** + *File count*: **5115** + *Folder count*: **518** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php index b93f4750d..6b24caf32 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFive/InstallScript.php @@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface */ public function get(object $extension): string { + // purge the object + $this->rest(); + // loop over methods and types foreach ($this->methods as $method) { @@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface return $this->build(); } + /** + * Reset all bucket at the start of each build + * + * @return void + * @since 3.2.0 + */ + protected function rest(): void + { + $this->construct = []; + $this->install = []; + $this->update = []; + $this->uninstall = []; + $this->preflightActive = false; + $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + $this->postflightActive = false; + $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + } + /** * build the install class * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php index ce1d45be7..a9acfa5d4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaFour/InstallScript.php @@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface */ public function get(object $extension): string { + // purge the object + $this->rest(); + // loop over methods and types foreach ($this->methods as $method) { @@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface return $this->build(); } + /** + * Reset all bucket at the start of each build + * + * @return void + * @since 3.2.0 + */ + protected function rest(): void + { + $this->construct = []; + $this->install = []; + $this->update = []; + $this->uninstall = []; + $this->preflightActive = false; + $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + $this->postflightActive = false; + $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + } + /** * build the install class * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php index 04a820576..c36a36bee 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php @@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface */ public function get(object $extension): string { + // purge the object + $this->rest(); + // loop over methods and types foreach ($this->methods as $method) { @@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface return $this->build(); } + /** + * Reset all bucket at the start of each build + * + * @return void + * @since 3.2.0 + */ + protected function rest(): void + { + $this->construct = []; + $this->install = []; + $this->update = []; + $this->uninstall = []; + $this->preflightActive = false; + $this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + $this->postflightActive = false; + $this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + } + /** * build the install class *