diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e1212b3..1518864c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,36 +1,25 @@ -# v5.0.0-rc1 +# v5.0.0-rc2 - Improved the Schema Table update engine (more). - Fix autoloader timing, and loading. -- Implement the Joomla Powers in JCB code, to move away from JClasses. +- Implement the Joomla Powers in JCB code, to move away from JClasses. +- Remove the SQL update, to only use the Schema updates of table columns to avoid collusion. -# v5.0.0-beta5 +# v5.0.0-beta +- Add the compiler menu back. +- Fix the CustomfolderlistField #1094 +- Add view list and single name fix. +- Add component code name fix. +- Add reset list of powers. +- Add Joomla powers for namespace dynamic management. +- Add fallback option to ensure that all JCB tables and fields exist. +- Move the powers autoloader to its own file. - Fix the media field size limitation. #1109 - Add dynamic datatype update to schema field check. - Fix version_update column size. - Improved the Schema Table update engine. -# v5.0.0-beta4 - -- Add fallback option to ensure that all JCB tables and fields exist. -- Move the powers autoloader to its own file. - -# v5.0.0-beta3 - -- Add Joomla powers for namespace dynamic management. - -# v5.0.0-beta2 - -- Add view list and single name fix. -- Add component code name fix. -- Add reset list of powers. - -# v5.0.0-beta1 - -- Add the compiler menu back. -- Fix the CustomfolderlistField #1094 - # v5.0.0-alpha - First alpha release of Component Builder towards Joomla 5 (very unstable...) @@ -54,9 +43,12 @@ - Add power path override option on component level. - Fix the sql build feature. #1032 -# v4.0.0-rc1 +# v4.0.0-rc2 -- Improved the Schema Table update engine (more). +- Improved the Schema Table update engine (more). +- Fix autoloader timing, and loading. +- Implement the Joomla Powers in JCB code, to move away from JClasses. +- Remove the SQL update, to only use the Schema updates of table columns to avoid collusion. # v3.2.0 diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index b7f822405..099284957 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -3210,7 +3210,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
-

Upgrade to Version 5.0.0-rc1 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 5.0.0-rc2 Was Successful! Let us know if anything is not working as expected.

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); diff --git a/README.md b/README.md index 6726adb42..467505e42 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-rc1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-rc2) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th April, 2024 -+ *Version*: 5.0.0-rc1 ++ *Last Build*: 30th April, 2024 ++ *Version*: 5.0.0-rc2 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **745920** ++ *Line count*: **745955** + *Field count*: **2097** -+ *File count*: **5293** ++ *File count*: **5289** + *Folder count*: **528** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 6726adb42..467505e42 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-rc1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-rc2) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th April, 2024 -+ *Version*: 5.0.0-rc1 ++ *Last Build*: 30th April, 2024 ++ *Version*: 5.0.0-rc2 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **745920** ++ *Line count*: **745955** + *Field count*: **2097** -+ *File count*: **5293** ++ *File count*: **5289** + *Folder count*: **528** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/sql/updates/mysql/4.0.0-rc1.sql b/admin/sql/updates/mysql/4.0.0-rc2.sql similarity index 100% rename from admin/sql/updates/mysql/4.0.0-rc1.sql rename to admin/sql/updates/mysql/4.0.0-rc2.sql diff --git a/admin/sql/updates/mysql/5.0.0-alpha.sql b/admin/sql/updates/mysql/5.0.0-alpha.sql index f98f6aec0..8b1378917 100644 --- a/admin/sql/updates/mysql/5.0.0-alpha.sql +++ b/admin/sql/updates/mysql/5.0.0-alpha.sql @@ -1,3 +1 @@ -ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_jcb_powers_path` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_javascript`; - -ALTER TABLE `#__componentbuilder_joomla_component` ADD `jcb_powers_path` VARCHAR(255) NOT NULL DEFAULT '' AFTER `javascript`; + diff --git a/admin/sql/updates/mysql/5.0.0-beta1.sql b/admin/sql/updates/mysql/5.0.0-beta.sql similarity index 100% rename from admin/sql/updates/mysql/5.0.0-beta1.sql rename to admin/sql/updates/mysql/5.0.0-beta.sql diff --git a/admin/sql/updates/mysql/5.0.0-beta2.sql b/admin/sql/updates/mysql/5.0.0-beta2.sql deleted file mode 100644 index d525a44ab..000000000 --- a/admin/sql/updates/mysql/5.0.0-beta2.sql +++ /dev/null @@ -1,28 +0,0 @@ -CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_power` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', - `description` TEXT NULL, - `guid` VARCHAR(36) NOT NULL DEFAULT '', - `settings` TEXT NOT NULL, - `system_name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, - `published` TINYINT(3) NOT NULL DEFAULT 1, - `created_by` INT(10) unsigned NOT NULL DEFAULT 0, - `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, - `created` DATETIME DEFAULT CURRENT_TIMESTAMP, - `modified` DATETIME DEFAULT NULL, - `checked_out` int(11) unsigned NOT NULL DEFAULT 0, - `checked_out_time` DATETIME DEFAULT NULL, - `version` INT(10) unsigned NOT NULL DEFAULT 1, - `hits` INT(10) unsigned NOT NULL DEFAULT 0, - `access` INT(10) unsigned NOT NULL DEFAULT 0, - `ordering` INT(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `idx_system_name` (`system_name`), - KEY `idx_guid` (`guid`), - KEY `idx_access` (`access`), - KEY `idx_checkout` (`checked_out`), - KEY `idx_createdby` (`created_by`), - KEY `idx_modifiedby` (`modified_by`), - KEY `idx_state` (`published`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; diff --git a/admin/sql/updates/mysql/5.0.0-beta3.sql b/admin/sql/updates/mysql/5.0.0-beta3.sql deleted file mode 100644 index 902532589..000000000 --- a/admin/sql/updates/mysql/5.0.0-beta3.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_php_method_install` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_helper_site`; -ALTER TABLE `#__componentbuilder_joomla_component` ADD `php_method_install` MEDIUMTEXT NOT NULL AFTER `php_helper_site`; diff --git a/admin/sql/updates/mysql/5.0.0-beta4.sql b/admin/sql/updates/mysql/5.0.0-beta4.sql deleted file mode 100644 index 59a009cf8..000000000 --- a/admin/sql/updates/mysql/5.0.0-beta4.sql +++ /dev/null @@ -1,18 +0,0 @@ -UPDATE `#__componentbuilder_admin_view` -SET `alias_builder_type` = 0 -WHERE `alias_builder_type` = ''; - -UPDATE `#__componentbuilder_dynamic_get` -SET `addcalculation` = 0 -WHERE `addcalculation` = ''; - -ALTER TABLE `#__componentbuilder_joomla_component` CHANGE `image` `image` VARCHAR(255) NOT NULL DEFAULT ''; -ALTER TABLE `#__componentbuilder_admin_view` CHANGE `alias_builder_type` `alias_builder_type` TINYINT(1) NOT NULL DEFAULT 0; -ALTER TABLE `#__componentbuilder_admin_view` CHANGE `icon` `icon` VARCHAR(255) NOT NULL DEFAULT ''; -ALTER TABLE `#__componentbuilder_admin_view` CHANGE `icon_add` `icon_add` VARCHAR(255) NOT NULL DEFAULT ''; -ALTER TABLE `#__componentbuilder_admin_view` CHANGE `icon_category` `icon_category` VARCHAR(255) NOT NULL DEFAULT ''; -ALTER TABLE `#__componentbuilder_custom_admin_view` CHANGE `icon` `icon` VARCHAR(255) NOT NULL DEFAULT ''; -ALTER TABLE `#__componentbuilder_dynamic_get` CHANGE `addcalculation` `addcalculation` TINYINT(1) NOT NULL DEFAULT 0; -ALTER TABLE `#__componentbuilder_component_updates` CHANGE `version_update` `version_update` MEDIUMTEXT NOT NULL; -ALTER TABLE `#__componentbuilder_joomla_module_updates` CHANGE `version_update` `version_update` MEDIUMTEXT NOT NULL; -ALTER TABLE `#__componentbuilder_joomla_plugin_updates` CHANGE `version_update` `version_update` MEDIUMTEXT NOT NULL; diff --git a/admin/sql/updates/mysql/5.0.0-beta5.sql b/admin/sql/updates/mysql/5.0.0-beta5.sql deleted file mode 100644 index 8b1378917..000000000 --- a/admin/sql/updates/mysql/5.0.0-beta5.sql +++ /dev/null @@ -1 +0,0 @@ - diff --git a/componentbuilder.xml b/componentbuilder.xml index be4989063..7b8492dd7 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 27th April, 2024 + 30th April, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 5.0.0-rc1 + 5.0.0-rc2 Component Builder (v.5.0.0-rc1) +

Component Builder (v.5.0.0-rc2)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 25d014a3c..557d74719 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -23,10 +23,10 @@ pkg_component_builder package site - 4.0.0-rc1 + 4.0.0-rc2 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-rc1.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-rc2.zip beta @@ -44,7 +44,7 @@ 5.0.0-alpha https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta1.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-alpha8.zip alpha @@ -59,79 +59,7 @@ pkg_component_builder package site - 5.0.0-beta1 - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta1.zip - - - beta - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 5.0.0-beta2 - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta2.zip - - - beta - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 5.0.0-beta3 - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta3.zip - - - beta - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 5.0.0-beta4 - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta4.zip - - - beta - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 5.0.0-beta5 + 5.0.0-beta https://dev.vdm.io https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-beta5.zip @@ -149,10 +77,10 @@ pkg_component_builder package site - 5.0.0-rc1 + 5.0.0-rc2 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-rc1.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-rc2.zip releasecandidate diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaPower/Extractor.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaPower/Extractor.php index 043954dcc..71835a2fb 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaPower/Extractor.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaPower/Extractor.php @@ -12,6 +12,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaPower; +use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\ExtractorInterface; use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor as ExtendingExtractor; diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php index 2f4b56a6d..bf14861fc 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php @@ -121,7 +121,8 @@ class Utilities implements ServiceProviderInterface public function getFileInjector(Container $container): FileInjector { return new FileInjector( - $container->get('Power.Injector') + $container->get('Power.Injector'), + $container->get('Joomla.Power.Injector') ); } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php index 47c9af0bf..eaf28e2c6 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php @@ -13,6 +13,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower\Injector as JoomlaPower; use VDM\Joomla\Utilities\MathHelper; @@ -33,23 +34,41 @@ final class FileInjector protected Power $power; /** - * The pattern to get the powers + * The Joomla Injector Class. + * + * @var JoomlaPower + * @since 3.2.1 + */ + protected JoomlaPower $joomla; + + /** + * The power pattern to get the powers * * @var string * @since 3.2.0 **/ - protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + protected string $powerPattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * The Joomla power pattern to get the powers + * + * @var string + * @since 3.2.1 + **/ + protected string $joomlaPattern = '/Joomla_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; /** * Constructor. * - * @param Power $power The Injector Class. + * @param Power $power The Injector Class. + * @param JoomlaPower $joomla The Joomla Injector Class. * - * @since 3.2.0 + * @since 3.2.1 */ - public function __construct(Power $power) + public function __construct(Power $power, JoomlaPower $joomla) { $this->power = $power; + $this->joomla = $joomla; } /** @@ -72,7 +91,9 @@ final class FileInjector throw new \InvalidArgumentException('Position cannot be negative.'); } - $found_super_powers = preg_match($this->pattern, $data); + $found_joomla_powers = preg_match($this->joomlaPattern, $data); + $found_super_powers = preg_match($this->powerPattern, $data); + $actual_file = $this->openFileWithLock($file); try @@ -85,6 +106,11 @@ final class FileInjector $this->processFile($actual_file, $temp_file, $data, $position, $replace); + if ($found_joomla_powers) + { + $this->injectJoomlaPowers($actual_file); + } + if ($found_super_powers) { $this->injectSuperPowers($actual_file); @@ -207,6 +233,28 @@ final class FileInjector ftruncate($actual_file, 0); rewind($actual_file); + fwrite($actual_file, $power_data); + } + + /** + * Injects Joomla powers into the file content, if found, and updates the file. + * + * @param resource $actual_file The file handle of the actual file. + * + * @return void + * @since 3.2.1 + */ + private function injectJoomlaPowers($actual_file): void + { + rewind($actual_file); + + $power_data = $this->joomla->power( + stream_get_contents($actual_file) + ); + + ftruncate($actual_file, 0); + rewind($actual_file); + fwrite($actual_file, $power_data); } }