Stable release of v4.0.0-alpha2

Fix the plug-in installer script builder bug #1067. Fix Event triggers for Joomla 4 and 5 builds.
This commit is contained in:
Robot 2024-03-11 18:22:04 +02:00
parent a7ade71c06
commit d590ada95f
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
10 changed files with 74 additions and 47 deletions

View File

@ -1,7 +1,12 @@
# v4.0.0-alpha2
- Fix the plug-in installer script builder bug #1067
- Fix Event triggers for Joomla 4 and 5 builds.
# v4.0.0-alpha1
- First alpha release of Component Builder towards Joomla 4 (very unstable...)
# v3.2.0-beta4
# v3.2.0-beta6
- Add Preferred Joomla Version to Components
- Fix the plug-in installer script builder bug #1068

View File

@ -3140,7 +3140,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 4.0.0-alpha1 Was Successful! Let us know if anything is not working as expected.</h3></div>';
<h3>Upgrade to Version 4.0.0-alpha2 Was Successful! Let us know if anything is not working as expected.</h3></div>';
// Add/Update component in the action logs extensions table.
$this->setActionLogsExtensions();

View File

@ -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 (4.0.0-alpha1) 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 (4.0.0-alpha2) 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)
@ -145,12 +145,12 @@ TODO
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 11th March, 2024
+ *Version*: 4.0.0-alpha1
+ *Version*: 4.0.0-alpha2
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **725229**
+ *Line count*: **725263**
+ *Field count*: **2078**
+ *File count*: **5115**
+ *File count*: **5116**
+ *Folder count*: **518**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).

View File

@ -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 (4.0.0-alpha1) 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 (4.0.0-alpha2) 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)
@ -145,12 +145,12 @@ TODO
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 11th March, 2024
+ *Version*: 4.0.0-alpha1
+ *Version*: 4.0.0-alpha2
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **725229**
+ *Line count*: **725263**
+ *Field count*: **2078**
+ *File count*: **5115**
+ *File count*: **5116**
+ *Folder count*: **518**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).

View File

@ -0,0 +1 @@

View File

@ -7,9 +7,9 @@
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>4.0.0-alpha1</version>
<version>4.0.0-alpha2</version>
<description><![CDATA[
<h1>Component Builder (v.4.0.0-alpha1)</h1>
<h1>Component Builder (v.4.0.0-alpha2)</h1>
<div style="clear: both;"></div>
<p>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.

View File

@ -5,10 +5,10 @@
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.2.0-beta4</version>
<version>3.2.0-beta6</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta4.zip</downloadurl>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta6.zip</downloadurl>
</downloads>
<tags>
<tag>beta</tag>
@ -35,4 +35,22 @@
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="4\.[1234]"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>4.0.0-alpha2</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-alpha2.zip</downloadurl>
</downloads>
<tags>
<tag>beta</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="4\.[1234]"/>
</update>
</updates>

View File

@ -26,13 +26,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
class Event implements EventInterface
{
/**
* event plugin trigger switch
* event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/**
* Constructor
*
@ -60,6 +67,8 @@ class Event implements EventInterface
}
}
}
$this->dispatcher = Factory::getApplication();
}
/**
@ -77,22 +86,14 @@ class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
// Get the dispatcher.
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
try
{
// Get the last error.
$error = $dispatcher->getError();
if (!($error instanceof \Exception))
{
throw new \Exception($error);
}
// Trigger this compiler event.
$results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
catch (\Exception $e)
{
throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}

View File

@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
use Joomla\CMS\Factory;
use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper;
use VDM\Joomla\Utilities\Component\Helper;
@ -26,13 +27,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
final class Event implements EventInterface
{
/**
* event plugin trigger switch
* event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/**
* Constructor
*
@ -60,6 +68,8 @@ final class Event implements EventInterface
}
}
}
$this->dispatcher = Factory::getApplication();
}
/**
@ -77,22 +87,14 @@ final class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
// Get the dispatcher.
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
try
{
// Get the last error.
$error = $dispatcher->getError();
if (!($error instanceof \Exception))
{
throw new \Exception($error);
}
// Trigger this compiler event.
$results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
catch (\Exception $e)
{
throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}