diff --git a/CHANGELOG.md b/CHANGELOG.md index 957e72080..f4b89f5a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,8 @@ -# v4.0.2-alpha2 +# v4.0.2-alpha3 -- Fix missing scripts and styles fields and methods in the site admin view model -- Update subform field layout across JCB for cleaner look -- Remove expansion feature -- Fix helper area +- Fix database mySql update in J4+ +- Remove phpspreadsheet completely from Joomla 4+ +- Add option to use powers in preflight event in the installer class # v4.0.2-alpha @@ -11,7 +10,11 @@ - Fix permissions tab in items in J4+ - Fix site display controller checkEditId function in J4+ - Add class methods to the HtmlView classes in J4+ -- Fix broken toolbar call in HtmlView in J4+ +- Fix broken toolbar call in HtmlView in J4+ +- Fix missing scripts and styles fields and methods in the site admin view model +- Update subform field layout across JCB for cleaner look +- Remove expansion feature +- Fix helper area # v4.0.1 diff --git a/ComponentbuilderInstallerPowerloader.php b/ComponentbuilderInstallerPowerloader.php new file mode 100644 index 000000000..a972b8833 --- /dev/null +++ b/ComponentbuilderInstallerPowerloader.php @@ -0,0 +1,60 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die; + +// register additional namespace +spl_autoload_register(function ($class) { + // project-specific base directories and namespace prefix + $search = [ + 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', + 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', + 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', + 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', + 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' + ]; + // Start the search and load if found + $found = false; + $found_base_dir = ""; + $found_len = 0; + foreach ($search as $base_dir => $prefix) + { + // does the class use the namespace prefix? + $len = strlen($prefix); + if (strncmp($prefix, $class, $len) === 0) + { + // we have a match so load the values + $found = true; + $found_base_dir = $base_dir; + $found_len = $len; + // done here + break; + } + } + // check if we found a match + if (!$found) + { + // not found so move to the next registered autoloader + return; + } + // get the relative class name + $relative_class = substr($class, $found_len); + // replace the namespace prefix with the base directory, replace namespace + // separators with directory separators in the relative class name, append + // with .php + $file = __DIR__ . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; + // if the file exists, require it + if (file_exists($file)) + { + require $file; + } +}); diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index 55c6e7768..217635085 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -19,6 +19,7 @@ use Joomla\CMS\Version; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\Filesystem\Folder; use Joomla\Database\DatabaseInterface; +use VDM\Joomla\Componentbuilder\PHPConfigurationChecker; use VDM\Joomla\Componentbuilder\Table\SchemaChecker; // No direct access to this file @@ -48,7 +49,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * The version number of the extension. * - * @var string + * @var string * @since 3.6 */ protected $release; @@ -56,7 +57,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * The table the parameters are stored in. * - * @var string + * @var string * @since 3.6 */ protected $paramTable; @@ -64,7 +65,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * The extension name. This should be set in the installer script. * - * @var string + * @var string * @since 3.6 */ protected $extension; @@ -72,7 +73,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * A list of files to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFiles = []; @@ -80,7 +81,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * A list of folders to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFolders = []; @@ -88,7 +89,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * A list of CLI script files to be copied to the cli directory * - * @var array + * @var array * @since 3.6 */ protected $cliScriptFiles = []; @@ -96,7 +97,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * Minimum PHP version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumPhp; @@ -104,7 +105,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface /** * Minimum Joomla! version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumJoomla; @@ -158,7 +159,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function install(InstallerAdapter $adapter): bool {return true;} @@ -180,7 +180,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function uninstall(InstallerAdapter $adapter): bool @@ -525,7 +524,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function preflight(string $type, InstallerAdapter $adapter): bool @@ -573,16 +571,22 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface $this->removeFolder($cleaner); } - // Check that the required configuration are set for PHP - $this->phpConfigurationCheck($this->app); + // Check that the PHP configurations are sufficient + if ($this->classExists(PHPConfigurationChecker::class)) + { + (new PHPConfigurationChecker())->run(); + } } // do any install needed if ($type === 'install') { - // Check that the required configuration are set for PHP - $this->phpConfigurationCheck($this->app); + // Check that the PHP configurations are sufficient + if ($this->classExists(PHPConfigurationChecker::class)) + { + (new PHPConfigurationChecker())->run(); + } } return true; @@ -595,7 +599,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function postflight(string $type, InstallerAdapter $adapter): bool @@ -3267,7 +3270,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
-

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

'; +

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

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); @@ -4105,7 +4108,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param array|null $ignore The folders and files to ignore and not remove. * * @return bool True if all specified files/folders are removed, false otherwise. - * @since 3.2.2 + * @since 3.2.2 */ protected function removeFolder(string $dir, ?array $ignore = null): bool { @@ -4156,7 +4159,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param array $ignore The folders and files to ignore. * * @return bool True if the directory is empty or contains only ignored items, false otherwise. - * @since 3.2.1 + * @since 3.2.1 */ protected function isDirEmpty(string $dir, array $ignore): bool { @@ -4176,7 +4179,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Remove the files and folders in the given array from * * @return void - * * @since 3.6 */ protected function removeFiles() @@ -4208,7 +4210,6 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Moves the CLI scripts into the CLI folder in the CMS * * @return void - * * @since 3.6 */ protected function moveCliFiles() @@ -4239,7 +4240,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $contentHistoryOptions * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setContentType( string $typeTitle, @@ -4301,7 +4302,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $textPrefix * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogConfig( string $typeTitle, @@ -4354,7 +4355,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Set action logs extensions integration * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogsExtensions(): void { @@ -4395,7 +4396,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $rules The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setAssetsRules(string $rules): void { @@ -4433,7 +4434,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $params The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setExtensionsParams(string $params): void { @@ -4476,7 +4477,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $dataType This datatype we will change the rules column to if it to small. * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void { @@ -4511,7 +4512,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param bool $fields The switch to also remove related field data * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewData(string $context, bool $fields = false): void { @@ -4534,7 +4535,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentTypes(string $context): void { @@ -4591,7 +4592,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFields(string $context): void { @@ -4653,7 +4654,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param array $ids The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsValues(string $context, array $ids): void { @@ -4684,7 +4685,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsGroups(string $context): void { @@ -4739,7 +4740,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewHistory(string $context): void { @@ -4771,7 +4772,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param array $ids The type ids * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmBase(array $ids): void { @@ -4804,7 +4805,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmContent(string $context): void { @@ -4836,7 +4837,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentItemTagMap(string $context): void { @@ -4871,7 +4872,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogConfig(string $context): void { @@ -4901,7 +4902,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Remove Asset Table Integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeAssetData(): void { @@ -4929,7 +4930,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Remove action logs extensions integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogsExtensions(): void { @@ -4959,7 +4960,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * Remove remove database fix (if possible) * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeDatabaseAssetsRulesFix(): void { @@ -4997,134 +4998,35 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface * @param string $className The fully qualified name of the class to check. * * @return bool True if the class exists or was successfully loaded, false otherwise. - * @since 4.0.1 + * @since 4.0.1 */ protected function classExists(string $className): bool { - if (!class_exists($className, true)) + if (class_exists($className, true)) { - // The power autoloader for this project (JPATH_ADMINISTRATOR) area. - $power_autoloader = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/src/Helper/PowerloaderHelper.php'; - if (file_exists($power_autoloader)) - { - require_once $power_autoloader; - } + return true; + } - // Check again if the class now exists after requiring the autoloader - if (!class_exists($className, true)) + // Autoloaders to check + $autoloaders = [ + __DIR__ . '/ComponentbuilderInstallerPowerloader.php', + JPATH_ADMINISTRATOR . '/components/com_componentbuilder/src/Helper/PowerloaderHelper.php' + ]; + + foreach ($autoloaders as $autoloader) + { + if (file_exists($autoloader)) { - return false; + require_once $autoloader; + + if (class_exists($className, true)) + { + return true; + } } } - return true; - } - /** - * Define the required limits with specific messages for success and warning scenarios - * - * @var array - * @since 3.2.1 - */ - protected array $requiredPHPConfigs = [ - 'upload_max_filesize' => [ - 'value' => '128M', - 'success' => 'The upload_max_filesize is appropriately set to handle large files, which is essential for uploading substantial components and media.', - 'warning' => 'The current upload_max_filesize may not support large file uploads effectively, potentially causing failures during component installation.' - ], - 'post_max_size' => [ - 'value' => '128M', - 'success' => 'The post_max_size setting is sufficient to manage large data submissions, ensuring smooth data processing within forms and uploads.', - 'warning' => 'An insufficient post_max_size can lead to truncated data submissions, affecting form functionality and data integrity.' - ], - 'max_execution_time' => [ - 'value' => 60, - 'success' => 'Max execution time is set high enough to execute complex operations without premature termination, which is crucial for lengthy operations.', - 'warning' => 'A low max execution time could lead to script timeouts, especially during intensive operations, which might interrupt execution and cause failures during the compiling of a large extension.' - ], - 'max_input_vars' => [ - 'value' => 7000, - 'success' => 'The max_input_vars setting supports a high number of input variables, facilitating complex forms and detailed component configurations.', - 'warning' => 'Too few max_input_vars may result in lost data during processing complex forms, which can lead to incomplete configurations and operational issues.' - ], - 'max_input_time' => [ - 'value' => 60, - 'success' => 'Max input time is adequate for processing inputs efficiently during high-load operations, ensuring no premature timeouts.', - 'warning' => 'An insufficient max input time could result in incomplete data processing during input-heavy operations, potentially leading to errors and data loss.' - ], - 'memory_limit' => [ - 'value' => '256M', - 'success' => 'The memory limit is set high to accommodate extensive operations and data processing, which enhances overall performance and stability.', - 'warning' => 'A low memory limit can lead to frequent crashes and performance issues, particularly when processing large amounts of data or complex calculations.' - ] - ]; - - /** - * Helper function to convert PHP INI memory values to bytes - * - * @param string $value The value to convert - * - * @return int The bytes value - * @since 3.2.1 - */ - protected function convertToBytes(string $value): int - { - $value = trim($value); - $lastChar = strtolower($value[strlen($value) - 1]); - $numValue = substr($value, 0, -1); - - switch ($lastChar) - { - case 'g': - return $numValue * 1024 * 1024 * 1024; - case 'm': - return $numValue * 1024 * 1024; - case 'k': - return $numValue * 1024; - default: - return (int) $value; - } - } - - /** - * Check that the required configurations are set for PHP - * - * @param $app The application - * - * @return void - * @since 3.2.1 - */ - protected function phpConfigurationCheck($app): void - { - $showHelp = false; - - // Check each configuration and provide detailed feedback - foreach ($this->requiredPHPConfigs as $configName => $configDetails) - { - $currentValue = ini_get($configName); - if ($currentValue === false) - { - $app->enqueueMessage("Error: Unable to retrieve current setting for '{$configName}'.", 'error'); - continue; - } - - $isMemoryValue = strpbrk($configDetails['value'], 'KMG') !== false; - $requiredValueBytes = $isMemoryValue ? $this->convertToBytes($configDetails['value']) : (int) $configDetails['value']; - $currentValueBytes = $isMemoryValue ? $this->convertToBytes($currentValue) : (int) $currentValue; - $conditionMet = $currentValueBytes >= $requiredValueBytes; - - $messageType = $conditionMet ? 'message' : 'warning'; - $messageText = $conditionMet ? - "Success: {$configName} is set to {$currentValue}. " . $configDetails['success'] : - "Warning: {$configName} configuration should be at least {$configDetails['value']} but is currently {$currentValue}. " . $configDetails['warning']; - $showHelp = ($showHelp || $messageType === 'warning') ? true : false; - $app->enqueueMessage($messageText, $messageType); - } - - if ($showHelp) - { - $app->enqueueMessage('To optimize your Joomla Component Builder (JCB) development environment, specific PHP settings must be enhanced.
These settings are crucial for ensuring the successful installation and compilation of extensions.
We\'ve identified that certain configurations currently do not meet the recommended standards.
To adjust these settings and prevent potential issues, please consult our detailed guide available at JCB PHP Settings Wiki. -', 'notice'); - } + return false; } /** diff --git a/README.md b/README.md index 8625d3ca3..16cdbc02e 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 (4.0.2-alpha2) 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.2-alpha3) 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*: 26th July, 2024 -+ *Version*: 4.0.2-alpha2 ++ *Last Build*: 27th July, 2024 ++ *Version*: 4.0.2-alpha3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **789762** ++ *Line count*: **791489** + *Field count*: **2093** -+ *File count*: **5484** ++ *File count*: **5500** + *Folder count*: **540** > 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 8625d3ca3..16cdbc02e 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 (4.0.2-alpha2) 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.2-alpha3) 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*: 26th July, 2024 -+ *Version*: 4.0.2-alpha2 ++ *Last Build*: 27th July, 2024 ++ *Version*: 4.0.2-alpha3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **789762** ++ *Line count*: **791489** + *Field count*: **2093** -+ *File count*: **5484** ++ *File count*: **5500** + *Folder count*: **540** > 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/compiler/joomla_3/script.php b/admin/compiler/joomla_3/script.php index 519d4514a..5083f10f3 100644 --- a/admin/compiler/joomla_3/script.php +++ b/admin/compiler/joomla_3/script.php @@ -28,6 +28,8 @@ HTML::_('bootstrap.renderModal'); /** * Script File of ###Component### Component + * + * @since 1.5.0 */ class Com_###Component###InstallerScript { @@ -35,6 +37,7 @@ class Com_###Component###InstallerScript * Constructor * * @param ComponentAdapter $parent The object responsible for running this script + * @since 1.5.0 */ public function __construct(ComponentAdapter $parent) {} @@ -44,6 +47,7 @@ class Com_###Component###InstallerScript * @param ComponentAdapter $parent The object responsible for running this script * * @return boolean True on success + * @since 1.5.0 */ public function install(ComponentAdapter $parent) {} @@ -51,6 +55,8 @@ class Com_###Component###InstallerScript * Called on uninstallation * * @param ComponentAdapter $parent The object responsible for running this script + * + * @since 1.5.0 */ public function uninstall(ComponentAdapter $parent) {###UNINSTALLSCRIPT### @@ -68,6 +74,7 @@ class Com_###Component###InstallerScript * @param ComponentAdapter $parent The object responsible for running this script * * @return boolean True on success + * @since 1.5.0 */ public function update(ComponentAdapter $parent){} @@ -78,6 +85,7 @@ class Com_###Component###InstallerScript * @param ComponentAdapter $parent The object responsible for running this script * * @return boolean True on success + * @since 1.5.0 */ public function preflight($type, ComponentAdapter $parent) { @@ -121,6 +129,7 @@ class Com_###Component###InstallerScript * @param ComponentAdapter $parent The object responsible for running this script * * @return boolean True on success + * @since 1.5.0 */ public function postflight($type, ComponentAdapter $parent) { @@ -144,7 +153,7 @@ class Com_###Component###InstallerScript * @param array|null $ignore The folders and files to ignore and not remove. * * @return bool True if all specified files/folders are removed, false otherwise. - * @since 3.2.2 + * @since 3.2.2 */ protected function removeFolder(string $dir, ?array $ignore = null): bool { @@ -195,7 +204,7 @@ class Com_###Component###InstallerScript * @param array $ignore The folders and files to ignore. * * @return bool True if the directory is empty or contains only ignored items, false otherwise. - * @since 3.2.1 + * @since 3.2.1 */ protected function isDirEmpty(string $dir, array $ignore): bool { @@ -217,7 +226,7 @@ class Com_###Component###InstallerScript * @input array The array to check * * @returns bool/int number of items in array on success - * @since 3.2.2 + * @since 3.2.2 */ protected function checkArray($array, $removeEmptyString = false) { @@ -247,20 +256,31 @@ class Com_###Component###InstallerScript * @param string $className The fully qualified name of the class to check. * * @return bool True if the class exists or was successfully loaded, false otherwise. - * @since 3.2.2 + * @since 3.2.2 */ protected function classExists(string $className): bool { - if (!class_exists($className, true)) + if (class_exists($className, true)) { -###THREE_POWER_AUTOLOADER### + return true; + } - // Check again if the class now exists after requiring the autoloader - if (!class_exists($className, true)) + // Autoloaders to check + $autoloaders = [###INSTALLER_POWER_AUTOLOADER_ARRAY###]; + + foreach ($autoloaders as $autoloader) + { + if (file_exists($autoloader)) { - return false; + require_once $autoloader; + + if (class_exists($className, true)) + { + return true; + } } } - return true; + + return false; }###INSTALLERMETHODS### } diff --git a/admin/compiler/joomla_3/script_powerloader.php b/admin/compiler/joomla_3/script_powerloader.php new file mode 100644 index 000000000..811b3af71 --- /dev/null +++ b/admin/compiler/joomla_3/script_powerloader.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###INSTALLER_POWER_HELPER### diff --git a/admin/compiler/joomla_3/settings.json b/admin/compiler/joomla_3/settings.json index ff301f6a6..3ba164be8 100644 --- a/admin/compiler/joomla_3/settings.json +++ b/admin/compiler/joomla_3/settings.json @@ -184,6 +184,12 @@ "rename": false, "type": "file" }, + "script_powerloader.php": { + "naam": "script_powerloader.php", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, "install.mysql.utf8.sql": { "naam": "install.mysql.utf8.sql", "path": "c0mp0n3nt/admin/sql", diff --git a/admin/compiler/joomla_4/INSTALLER_AUTOLOADER_CLASS.php b/admin/compiler/joomla_4/INSTALLER_AUTOLOADER_CLASS.php new file mode 100644 index 000000000..2f53692a6 --- /dev/null +++ b/admin/compiler/joomla_4/INSTALLER_AUTOLOADER_CLASS.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###INSTALLER_POWER_HELPER### diff --git a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php index f57ad2cd1..ead990145 100644 --- a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php +++ b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php @@ -52,7 +52,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * The version number of the extension. * - * @var string + * @var string * @since 3.6 */ protected $release; @@ -60,7 +60,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * The table the parameters are stored in. * - * @var string + * @var string * @since 3.6 */ protected $paramTable; @@ -68,7 +68,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * The extension name. This should be set in the installer script. * - * @var string + * @var string * @since 3.6 */ protected $extension; @@ -76,7 +76,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * A list of files to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFiles = []; @@ -84,7 +84,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * A list of folders to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFolders = []; @@ -92,7 +92,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * A list of CLI script files to be copied to the cli directory * - * @var array + * @var array * @since 3.6 */ protected $cliScriptFiles = []; @@ -100,7 +100,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * Minimum PHP version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumPhp; @@ -108,7 +108,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface /** * Minimum Joomla! version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumJoomla; @@ -162,7 +162,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function install(InstallerAdapter $adapter): bool {return true;} @@ -184,7 +183,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function uninstall(InstallerAdapter $adapter): bool @@ -207,7 +205,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function preflight(string $type, InstallerAdapter $adapter): bool @@ -252,7 +249,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function postflight(string $type, InstallerAdapter $adapter): bool @@ -284,7 +280,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param array|null $ignore The folders and files to ignore and not remove. * * @return bool True if all specified files/folders are removed, false otherwise. - * @since 3.2.2 + * @since 3.2.2 */ protected function removeFolder(string $dir, ?array $ignore = null): bool { @@ -335,7 +331,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param array $ignore The folders and files to ignore. * * @return bool True if the directory is empty or contains only ignored items, false otherwise. - * @since 3.2.1 + * @since 3.2.1 */ protected function isDirEmpty(string $dir, array $ignore): bool { @@ -355,7 +351,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Remove the files and folders in the given array from * * @return void - * * @since 3.6 */ protected function removeFiles() @@ -387,7 +382,6 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Moves the CLI scripts into the CLI folder in the CMS * * @return void - * * @since 3.6 */ protected function moveCliFiles() @@ -418,7 +412,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $contentHistoryOptions * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setContentType( string $typeTitle, @@ -480,7 +474,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $textPrefix * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogConfig( string $typeTitle, @@ -533,7 +527,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Set action logs extensions integration * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogsExtensions(): void { @@ -574,7 +568,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $rules The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setAssetsRules(string $rules): void { @@ -612,7 +606,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $params The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setExtensionsParams(string $params): void { @@ -655,7 +649,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $dataType This datatype we will change the rules column to if it to small. * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void { @@ -690,7 +684,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param bool $fields The switch to also remove related field data * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewData(string $context, bool $fields = false): void { @@ -713,7 +707,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentTypes(string $context): void { @@ -770,7 +764,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFields(string $context): void { @@ -832,7 +826,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param array $ids The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsValues(string $context, array $ids): void { @@ -863,7 +857,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsGroups(string $context): void { @@ -918,7 +912,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewHistory(string $context): void { @@ -950,7 +944,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param array $ids The type ids * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmBase(array $ids): void { @@ -983,7 +977,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmContent(string $context): void { @@ -1015,7 +1009,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentItemTagMap(string $context): void { @@ -1050,7 +1044,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogConfig(string $context): void { @@ -1080,7 +1074,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Remove Asset Table Integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeAssetData(): void { @@ -1108,7 +1102,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Remove action logs extensions integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogsExtensions(): void { @@ -1138,7 +1132,7 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * Remove remove database fix (if possible) * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeDatabaseAssetsRulesFix(): void { @@ -1176,20 +1170,31 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface * @param string $className The fully qualified name of the class to check. * * @return bool True if the class exists or was successfully loaded, false otherwise. - * @since 4.0.1 + * @since 4.0.1 */ protected function classExists(string $className): bool { - if (!class_exists($className, true)) + if (class_exists($className, true)) { -###THREE_POWER_AUTOLOADER### + return true; + } - // Check again if the class now exists after requiring the autoloader - if (!class_exists($className, true)) + // Autoloaders to check + $autoloaders = [###INSTALLER_POWER_AUTOLOADER_ARRAY###]; + + foreach ($autoloaders as $autoloader) + { + if (file_exists($autoloader)) { - return false; + require_once $autoloader; + + if (class_exists($className, true)) + { + return true; + } } } - return true; + + return false; }###INSTALLERMETHODS### } diff --git a/admin/compiler/joomla_4/settings.json b/admin/compiler/joomla_4/settings.json index a9e17839f..dfc6be80c 100644 --- a/admin/compiler/joomla_4/settings.json +++ b/admin/compiler/joomla_4/settings.json @@ -182,6 +182,13 @@ "newName": "[[[Component]]]InstallerScript.php", "type": "file" }, + "INSTALLER_AUTOLOADER_CLASS.php": { + "naam": "INSTALLER_AUTOLOADER_CLASS.php", + "path": "c0mp0n3nt/", + "rename": "new", + "newName": "[[[Component]]]InstallerPowerloader.php", + "type": "file" + }, "SITE_DISPATCHER.php": { "naam": "SITE_DISPATCHER.php", "path": "c0mp0n3nt/site/src/Dispatcher", diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index f034c0101..c247ca9e4 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -2087,8 +2087,8 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_files_folders_urls -- Dumping data for table `#__componentbuilder_joomla_component` -- -INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_admin_event`, `add_backup_folder_path`, `add_css_admin`, `add_css_site`, `add_email_helper`, `add_git_folder_path`, `add_javascript`, `add_menu_prefix`, `add_namespace_prefix`, `add_php_helper_admin`, `add_php_helper_both`, `add_php_helper_site`, `add_php_method_uninstall`, `add_php_postflight_install`, `add_php_postflight_update`, `add_php_preflight_install`, `add_php_preflight_update`, `add_placeholders`, `add_powers`, `add_sales_server`, `add_site_event`, `add_sql`, `add_sql_uninstall`, `add_update_server`, `addcontributors`, `addfootable`, `addreadme`, `adduikit`, `assets_table_fix`, `author`, `backup_folder_path`, `bom`, `buildcomp`, `buildcompsql`, `companyname`, `component_version`, `copyright`, `created`, `creatuserhelper`, `crowdin_account_api_key`, `crowdin_project_api_key`, `crowdin_project_identifier`, `crowdin_username`, `css_admin`, `css_site`, `dashboard`, `dashboard_type`, `debug_linenr`, `description`, `email`, `emptycontributors`, `export_buy_link`, `export_key`, `git_folder_path`, `guid`, `image`, `javascript`, `joomla_source_link`, `license`, `menu_prefix`, `modified`, `mvc_versiondate`, `name`, `name_code`, `namespace_prefix`, `number`, `php_admin_event`, `php_helper_admin`, `php_helper_both`, `php_helper_site`, `php_method_uninstall`, `php_method_install`, `php_postflight_install`, `php_postflight_update`, `php_preflight_install`, `php_preflight_update`, `php_site_event`, `readme`, `remove_line_breaks`, `sales_server`, `short_description`, `sql`, `sql_uninstall`, `system_name`, `toignore`, `translation_tool`, `update_server`, `update_server_target`, `update_server_url`, `website`, `params`, `published`, `version`, `hits`, `access`, `ordering`) VALUES -(25, '', '', '', '', '', '', '', 1, '', '', 1, '', '', 1, '', '', '', '', 1, '', '', '', '', 1, '{}', '', 1, 3, 3, 'Llewellyn van der Merwe', '', 'default.txt', '', '', 'Vast Development Method', '5.0.0', 'Copyright (C) 2015. All Rights Reserved', '2016-10-18 11:44:09', '', 'BKOovsWQYpI1/DftxJdh22c7VUTW+DbsEpvijThZVb8=', 'viXPxL3sACxVmJCWobPtDApldszYq3vgSTQzz1LQP8o=', '', 'wU3a70YtpU0jm9Grylbb3qieXzFRRdlaGmH0mzZPYE4=', '', '', '', 1, '', 'Just a basic demo of the most basic implementations of the [Joomla](http://www.joomla.org) Component Builder\'s ability.', 'joomla@vdm.io', '', '', '8WWA4GgT+GBAlpyo/qAzoTOqlKF4D+nl51twlkYmuXI=', '', 'efde995e-60aa-4b39-b644-44349dfb660d', 'images/vdm/demo500.jpg', '', 'https://github.com/Llewellynvdm/Joomla-Demo-Component', 'GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html', '»', '2024-07-26 14:09:55', '', 'Demo', 'Demo', 'JCB', 4, '', '', 'CS8qKg0KCSAqCUNoYW5nZSB0byBuaWNlIGZhbmN5IGRhdGUNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGZhbmN5RGF0ZSgkZGF0ZSkNCgl7DQoJCWlmICghc2VsZjo6aXNWYWxpZFRpbWVTdGFtcCgkZGF0ZSkpDQoJCXsNCgkJCSRkYXRlID0gc3RydG90aW1lKCRkYXRlKTsNCgkJfQ0KCQlyZXR1cm4gZGF0ZSgnalMgXG9cZiBGIFknLCRkYXRlKTsNCgl9DQoNCgkvKioNCgkgKglDaGFuZ2UgdG8gbmljZSBmYW5jeSB0aW1lIGFuZCBkYXRlDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBmYW5jeURhdGVUaW1lKCR0aW1lKQ0KCXsNCgkJaWYgKCFzZWxmOjppc1ZhbGlkVGltZVN0YW1wKCR0aW1lKSkNCgkJew0KCQkJJHRpbWUgPSBzdHJ0b3RpbWUoJHRpbWUpOw0KCQl9DQoJCXJldHVybiBkYXRlKCcoRzppKSBqUyBcb1xmIEYgWScsJHRpbWUpOw0KCX0NCg0K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usercontent.com/namibia/demo-joomla-3-component/master/demo_updateserver.xml', 'https://www.vdm.io/', '{\"language_options\":{\"activate\":\"0\",\"use_percentagelanguageadd\":\"1\",\"percentagelanguageadd\":\"50\"},\"joomla_component_headers\":{\"add_admin_component\":\"0\",\"admin_component\":\"\",\"power_admin_component\":[],\"add_site_component\":\"0\",\"site_component\":\"\",\"power_site_component\":[],\"add_admin_helper\":\"0\",\"admin_helper\":\"\",\"power_admin_helper\":[],\"add_site_helper\":\"0\",\"site_helper\":\"\",\"power_site_helper\":[]}}', 1, 58, '', 1, 10); +INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_admin_event`, `add_backup_folder_path`, `add_css_admin`, `add_css_site`, `add_email_helper`, `add_git_folder_path`, `add_javascript`, `add_jcb_powers_path`, `add_menu_prefix`, `add_namespace_prefix`, `add_php_helper_admin`, `add_php_helper_both`, `add_php_helper_site`, `add_php_method_uninstall`, `add_php_postflight_install`, `add_php_postflight_update`, `add_php_preflight_install`, `add_php_preflight_update`, `add_placeholders`, `add_powers`, `add_sales_server`, `add_site_event`, `add_sql`, `add_sql_uninstall`, `add_update_server`, `addcontributors`, `addfootable`, `addreadme`, `adduikit`, `assets_table_fix`, `author`, `backup_folder_path`, `bom`, `buildcomp`, `buildcompsql`, `companyname`, `component_version`, `copyright`, `created`, `creatuserhelper`, `crowdin_account_api_key`, `crowdin_project_api_key`, `crowdin_project_identifier`, `crowdin_username`, `css_admin`, `css_site`, `dashboard`, `dashboard_type`, `debug_linenr`, `description`, `email`, `emptycontributors`, `export_buy_link`, `export_key`, `git_folder_path`, `guid`, `image`, `javascript`, `jcb_powers_path`, `joomla_source_link`, `license`, `menu_prefix`, `modified`, `mvc_versiondate`, `name`, `name_code`, `namespace_prefix`, `number`, `php_admin_event`, `php_helper_admin`, `php_helper_both`, `php_helper_site`, `php_method_uninstall`, `php_method_install`, `php_postflight_install`, `php_postflight_update`, `php_preflight_install`, `php_preflight_update`, `php_site_event`, `preferred_joomla_version`, `readme`, `remove_line_breaks`, `sales_server`, `short_description`, `sql`, `sql_uninstall`, `system_name`, `toignore`, `translation_tool`, `update_server`, `update_server_target`, `update_server_url`, `website`, `params`, `published`, `version`, `hits`, `access`, `ordering`) VALUES +(25, '', '', '', '', '', '', '', 1, 1, '', '', 1, '', '', 1, 1, 1, 1, '', 1, '', '', '', '', 1, '{}', '', 1, 3, 3, 'Llewellyn van der Merwe', '', 'default.txt', '', '', 'Vast Development Method', '5.0.0', 'Copyright (C) 2015. All Rights Reserved', '2016-10-18 11:44:09', '', '6Czr+0dclpw2DP5349CySufDDZodETdRK6PqgAgsWmQ=', 'L+Zxx5r4izmuIH34ys5WjJeugFu7belTFg667n9FLJ4=', '', 'xiJ4RIc7//ZBwlPpTwqeyUV6wVjPPuseC+m4E5bsVP8=', '', '', '', 1, '', 'Just a basic demo of the most basic implementations of the [Joomla](http://www.joomla.org) Component Builder\'s ability.', 'joomla@vdm.io', '', '', 'Hql5z9PBZh7yhl1OSKkD5WOZSiuybVKCqiFBvJaF/H8=', '', 'efde995e-60aa-4b39-b644-44349dfb660d', 'images/vdm/demo500.jpg', '', 'libraries/jcb_demo', 'https://github.com/Llewellynvdm/Joomla-Demo-Component', 'GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html', '»', '2024-07-27 20:27:52', '', 'Demo', 'Demo', 'JCB', 4, '', '', 'CS8qKg0KCSAqCUNoYW5nZSB0byBuaWNlIGZhbmN5IGRhdGUNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGZhbmN5RGF0ZSgkZGF0ZSkNCgl7DQoJCWlmICghc2VsZjo6aXNWYWxpZFRpbWVTdGFtcCgkZGF0ZSkpDQoJCXsNCgkJCSRkYXRlID0gc3RydG90aW1lKCRkYXRlKTsNCgkJfQ0KCQlyZXR1cm4gZGF0ZSgnalMgXG9cZiBGIFknLCRkYXRlKTsNCgl9DQoNCgkvKioNCgkgKglDaGFuZ2UgdG8gbmljZSBmYW5jeSB0aW1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hbm5pbmcsIG1hcHBpbmcgJiBkZWJ1Z2dpbmcuKQ0KDQpQcm9qZWN0IGR1cmF0aW9uOiAqKiMjI3Byb2plY3RXZWVrVGltZSMjIyB3ZWVrcyoqIG9yICoqIyMjcHJvamVjdE1vbnRoVGltZSMjIyBtb250aHMqKg0KDQo+IFRoaXMgKipjb21wb25lbnQqKiB3YXMgYnVpbGQgd2l0aCBhIEpvb21sYSBbQXV0b21hdGVkIENvbXBvbmVudCBCdWlsZGVyXShodHRwczovL3d3dy52ZG0uaW8vam9vbWxhLWNvbXBvbmVudC1idWlsZGVyKS4NCj4gRGV2ZWxvcGVkIGJ5IFtMbGV3ZWxseW4gdmFuIGRlciBNZXJ3ZV0obWFpbHRvOmpvb21sYUB2ZG0uaW8pDQoNCltDVVNUT01DT0RFPXJlYWRNRWNvbnRyaWJ1dG9yc10=', '', '', 'Demo Component', '', '', 'Demo (public)', '.git', '', '', 2, 'https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/demo_updateserver.xml', 'https://www.vdm.io/', '{\"language_options\":{\"activate\":\"0\",\"use_percentagelanguageadd\":\"1\",\"percentagelanguageadd\":\"50\"},\"joomla_component_headers\":{\"add_admin_component\":\"0\",\"admin_component\":\"\",\"power_admin_component\":[],\"add_site_component\":\"0\",\"site_component\":\"\",\"power_site_component\":[],\"add_admin_helper\":\"0\",\"admin_helper\":\"\",\"power_admin_helper\":[],\"add_site_helper\":\"0\",\"site_helper\":\"\",\"power_site_helper\":[]}}', 1, 63, '', 1, 10); -- -- Dumping data for table `#__componentbuilder_joomla_plugin` @@ -2130,6 +2130,22 @@ INSERT INTO `#__componentbuilder_dynamic_get` (`id`, `add_php_after_getitem`, `a (36, '', '', 1, '', '', '', '', '', '', 'CQkvLyBkbyBhIHF1aWNrIGJ1aWxkIG9mIGFsbCBlZGl0IGxpbmtzIGxpbmtzDQoJCWlmIChpc3NldCgkaXRlbXMpICYmICRpdGVtcykNCgkJew0KCQkJZm9yZWFjaCAoJGl0ZW1zIGFzICRuciA9PiAmJGl0ZW0pDQoJCQl7DQoJCQkJJGNhbkRvID0gW1tbQ29tcG9uZW50XV1dSGVscGVyOjpnZXRBY3Rpb25zKCdsb29rJywkaXRlbSwnbG9va3MnKTsNCgkJCQlpZiAoJGNhbkRvLT5nZXQoJ2xvb2suZWRpdCcpKQ0KCQkJCXsNCgkJCQkJJGl0ZW0tPmVkaXRMaW5rID0gJzxiciAvPjxiciAvPjxhIGNsYXNzPSJ1ay1idXR0b24gdWstYnV0dG9uLXByaW1hcnkgdWstd2lkdGgtMS0xIiBocmVmPSInOw0KCQkJCQkkaXRlbS0+ZWRpdExpbmsgLj0gSm9vbWxhX19fZDRjNzYwOTlfNGMzMl80MDhhXzg3MDFfZDBhNzI0NDg0ZGZkX19fUG93ZXI6Ol8oJ2luZGV4LnBocD9vcHRpb249Y29tX1tbW2NvbXBvbmVudF1dXSZ2aWV3PWxvb2smdGFzaz1sb29rLmVkaXQmaWQ9JyAuICRpdGVtLT5pZCk7DQoJCQkJCSRpdGVtLT5lZGl0TGluayAuPSAnIj48aSBjbGFzcz0idWstaWNvbi1wZW5jaWwiPjwvaT48c3BhbiBjbGFzcz0idWstaGlkZGVuLXNtYWxsIj4nOw0KCQkJCQkkaXRlbS0+ZWRpdExpbmsgLj0gVGV4dDo6XygnRWRpdCBMb29rJyk7DQoJCQkJCSRpdGVtLT5lZGl0TGluayAuPSAnPC9zcGFuPjwvYT4nOw0KCQkJCX0NCgkJCQllbHNlDQoJCQkJew0KCQkJCQkkaXRlbS0+ZWRpdExpbmsgPSAnJzsNCgkJCQl9DQoJCQl9DQoJCX0=', 1, '', '', '', '', '', 2, '', '', '', 1, 'Looks', '{\"order0\":{\"table_key\":\"a.name\",\"direction\":\"ASC\"}}', '', '', 'a.*', 109, '{\"where0\":{\"table_key\":\"a.published\",\"operator\":\"1\",\"value_key\":\"1\"}}', '', '', '', 1, 12, '', 13, '32b3ae7d-8aa8-47f1-ab2e-30076ddaa029'), (39, '', '', '', '', '', '', '', '', '', '', 1, '', '', '', '{\"filter0\":{\"filter_type\":\"1\",\"state_key\":\"id\",\"operator\":\"1\",\"table_key\":\"a.id\"}}', '', 1, '', '', '', 1, 'Looking', '', '', '', 'a.id AS id\r\na.name AS name\r\na.alias AS alias\r\na.description AS description\r\na.add AS add\r\na.email AS email\r\na.mobile_phone AS mobile_phone\r\na.dateofbirth AS dateofbirth\r\na.image AS image\r\na.website AS website\r\na.published AS published\r\na.hits AS hits\r\na.created_by AS created_by', 109, '', '', '', '', 1, 8, '', '', '98e6ea56-0911-4d89-b1f4-8f0bb1e4aa5a'); +-- +-- Dumping data for table `#__componentbuilder_placeholder` +-- + +INSERT INTO `#__componentbuilder_placeholder` (`id`, `target`, `value`, `params`, `published`, `created`, `modified`) VALUES +(19, '[[[gitea_api_url]]]', 'aHR0cHM6Ly9naXQudmRtLmRldi9hcGkvdjE=', '', 1, '2021-12-04 02:34:16', '2022-01-07 20:15:57'), +(20, '[[[COMPANY]]]', 'VkRN', '', 1, '2021-12-05 20:36:52', '2021-12-05 20:37:11'), +(21, '[[[gitea_url]]]', 'Z2l0LnZkbS5kZXY=', '', 1, '2023-07-08 07:54:21', '0000-00-00 00:00:00'), +(25, '[[[upload_max_filesize]]]', 'MTI4TQ==', '', 1, '2024-04-25 07:24:25', '0000-00-00 00:00:00'), +(26, '[[[post_max_size]]]', 'MTI4TQ==', '', 1, '2024-04-25 07:24:50', '0000-00-00 00:00:00'), +(27, '[[[max_execution_time]]]', 'NjA=', '', 1, '2024-04-25 07:25:11', '0000-00-00 00:00:00'), +(28, '[[[max_input_vars]]]', 'NzAwMA==', '', 1, '2024-04-25 07:25:27', '0000-00-00 00:00:00'), +(29, '[[[max_input_time]]]', 'NjA=', '', 1, '2024-04-25 07:25:43', '0000-00-00 00:00:00'), +(30, '[[[memory_limit]]]', 'MjU2TQ==', '', 1, '2024-04-25 07:26:05', '0000-00-00 00:00:00'), +(31, '[[[environment_wiki_url]]]', 'Z2l0LnZkbS5kZXYvam9vbWxhL0NvbXBvbmVudC1CdWlsZGVyL3dpa2kvUEhQLVNldHRpbmdz', '', 1, '2024-07-27 12:58:39', '0000-00-00 00:00:00'); + -- -- Dumping data for table `#__componentbuilder_library` -- @@ -2564,6 +2580,13 @@ INSERT INTO `#__componentbuilder_component_dashboard` (`id`, `dashboard_tab`, `j INSERT INTO `#__componentbuilder_component_files_folders` (`id`, `addfiles`, `addfolders`, `joomla_component`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `addfilesfullpath`, `addfoldersfullpath`) VALUES (27, '', '', 25, '', 1, '2017-10-28 03:56:26', '0000-00-00 00:00:00', 2, '', '', '', ''); +-- +-- Dumping data for table `#__componentbuilder_component_placeholders` +-- + +INSERT INTO `#__componentbuilder_component_placeholders` (`id`, `addplaceholders`, `joomla_component`, `params`, `published`, `created`, `modified`) VALUES +(43, '{\"addplaceholders0\":{\"target\":\"[[[upload_max_filesize]]]\",\"value\":\"7M\"},\"addplaceholders1\":{\"target\":\"[[[post_max_size]]]\",\"value\":\"6M\"},\"addplaceholders2\":{\"target\":\"[[[max_execution_time]]]\",\"value\":\"10\"},\"addplaceholders3\":{\"target\":\"[[[max_input_vars]]]\",\"value\":\"1000\"},\"addplaceholders4\":{\"target\":\"[[[max_input_time]]]\",\"value\":\"10\"},\"addplaceholders5\":{\"target\":\"[[[memory_limit]]]\",\"value\":\"16M\"},\"addplaceholders6\":{\"target\":\"[[[environment_wiki_url]]]\",\"value\":\"#\"}}', 25, '', 1, '2024-07-27 13:02:05', '2024-07-27 20:26:43'); + -- -- Dumping data for table `#__componentbuilder_snippet_type` -- diff --git a/admin/src/Model/Joomla_componentModel.php b/admin/src/Model/Joomla_componentModel.php index 82910d9f4..b099b6145 100644 --- a/admin/src/Model/Joomla_componentModel.php +++ b/admin/src/Model/Joomla_componentModel.php @@ -1467,7 +1467,10 @@ class Joomla_componentModel extends AdminModel } // make sure that the component code name is safe. - $data['name_code'] = ComponentCodeNameHelper::safe($data['name_code']); + if (!empty($data['system_name']) && UtilitiesStringHelper::check($data['system_name'])) + { + $data['name_code'] = ComponentCodeNameHelper::safe($data['name_code']); + } // Set the GUID if empty or not valid if (empty($data['guid']) && $data['id'] > 0) diff --git a/componentbuilder.xml b/componentbuilder.xml index eef7c3144..904dd478d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 26th July, 2024 + 27th July, 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 - 4.0.2-alpha2 + 4.0.2-alpha3 Component Builder (v.4.0.2-alpha2) +

Component Builder (v.4.0.2-alpha3)

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 25db33292..3a8c40692 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -62,7 +62,7 @@ 4.0.2-alpha https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-alpha2.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-alpha3.zip alpha @@ -77,10 +77,10 @@ pkg_component_builder package site - 4.0.2-alpha2 + 4.0.2-alpha3 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-alpha2.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-alpha3.zip alpha diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/PHPConfigurationChecker.php b/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/PHPConfigurationChecker.php new file mode 100644 index 000000000..0195786cd --- /dev/null +++ b/libraries/vendor_jcb/VDM.Joomla/src/Abstraction/PHPConfigurationChecker.php @@ -0,0 +1,214 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Abstraction; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Interfaces\PHPConfigurationCheckerInterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * PHP Configuration Checker + * + * @since 5.0.2 + */ +abstract class PHPConfigurationChecker extends Registry implements PHPConfigurationCheckerInterface +{ + /** + * The upload max filesize value + * + * @var string + * @since 5.0.2 + **/ + protected string $upload_max_filesize; + + /** + * The post max size value + * + * @var string + * @since 5.0.2 + **/ + protected string $post_max_size; + + /** + * The max execution time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_execution_time; + + /** + * The max input vars value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_vars; + + /** + * The max input time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_time; + + /** + * The memory limit value + * + * @var string + * @since 5.0.2 + **/ + protected string $memory_limit; + + /** + * The registry array. + * + * @var array + * @since 5.0.2 + **/ + protected array $active = [ + 'php' => [ + 'upload_max_filesize' => [ + 'success' => 'The upload_max_filesize is appropriately set to handle large files, which is essential for uploading substantial components and media.', + 'warning' => 'The current upload_max_filesize may not support large file uploads effectively, potentially causing failures during component installation.' + ], + 'post_max_size' => [ + 'success' => 'The post_max_size setting is sufficient to manage large data submissions, ensuring smooth data processing within forms and uploads.', + 'warning' => 'An insufficient post_max_size can lead to truncated data submissions, affecting form functionality and data integrity.' + ], + 'max_execution_time' => [ + 'success' => 'Max execution time is set high enough to execute complex operations without premature termination, which is crucial for lengthy operations.', + 'warning' => 'A low max execution time could lead to script timeouts, especially during intensive operations, which might interrupt execution and cause failures during the compiling of a large extension.' + ], + 'max_input_vars' => [ + 'success' => 'The max_input_vars setting supports a high number of input variables, facilitating complex forms and detailed component configurations.', + 'warning' => 'Too few max_input_vars may result in lost data during processing complex forms, which can lead to incomplete configurations and operational issues.' + ], + 'max_input_time' => [ + 'success' => 'Max input time is adequate for processing inputs efficiently during high-load operations, ensuring no premature timeouts.', + 'warning' => 'An insufficient max input time could result in incomplete data processing during input-heavy operations, potentially leading to errors and data loss.' + ], + 'memory_limit' => [ + 'success' => 'The memory limit is set high to accommodate extensive operations and data processing, which enhances overall performance and stability.', + 'warning' => 'A low memory limit can lead to frequent crashes and performance issues, particularly when processing large amounts of data or complex calculations.' + ] + ], + 'environment' => [ + 'name' => 'extension environment', + 'objective' => 'These settings are crucial for ensuring the successful installation and stable functionality of the extension.', + 'wiki_name' => 'PHP Settings Wiki', + 'wiki_url' => '#' + ] + ]; + + /** + * Application object. + * + * @since 5.0.2 + **/ + protected $app; + + /** + * Constructor. + * + * @param $app The app object. + * + * @since 5.0.2 + */ + public function __construct($app = null) + { + $this->app = $app ?: Factory::getApplication(); + + // set the required PHP Configures + $this->set('php.upload_max_filesize.value', $this->upload_max_filesize); + $this->set('php.post_max_size.value', $this->post_max_size); + $this->set('php.max_execution_time.value', $this->max_execution_time); + $this->set('php.max_input_vars.value', $this->max_input_vars); + $this->set('php.max_input_time.value', $this->max_input_time); + $this->set('php.memory_limit.value', $this->memory_limit); + } + + /** + * Check that the required configurations are set for PHP + * + * @return void + * @since 5.0.2 + **/ + public function run(): void + { + $showHelp = false; + + // Check each configuration and provide detailed feedback + $configurations = $this->active['php'] ?? []; + foreach ($configurations as $configName => $configDetails) + { + $currentValue = ini_get($configName); + if ($currentValue === false) + { + $this->app->enqueueMessage("Error: Unable to retrieve current setting for '{$configName}'.", 'error'); + continue; + } + + $requiredValue = $configDetails['value'] ?? 0; + $isMemoryValue = strpbrk($requiredValue, 'KMG') !== false; + + $requiredValueBytes = $isMemoryValue ? $this->convertToBytes($requiredValue) : (int) $requiredValue; + $currentValueBytes = $isMemoryValue ? $this->convertToBytes($currentValue) : (int) $currentValue; + $conditionMet = $currentValueBytes >= $requiredValueBytes; + + $messageType = $conditionMet ? 'message' : 'warning'; + $messageText = $conditionMet ? + "Success: {$configName} is set to {$currentValue}. " . $configDetails['success'] ?? '': + "Warning: {$configName} configuration should be at least {$requiredValue} but is currently {$currentValue}. " . $configDetails['warning'] ?? ''; + + $showHelp = ($showHelp || $messageType === 'warning') ? true : false; + + $this->app->enqueueMessage($messageText, $messageType); + } + + if ($showHelp) + { + $this->app->enqueueMessage("To optimize your {$this->get('environment.name', 'extension')}, specific PHP settings must be enhanced.
{$this->get('environment.objective', '')}
We've identified that certain configurations currently do not meet the recommended standards.
To adjust these settings and prevent potential issues, please consult our detailed guide available at get('environment.wiki_url', '#')}\" target=\"_blank\">{$this->get('environment.wiki_name', 'PHP Settings Wiki')}.", 'notice'); + } + } + + /** + * Helper function to convert PHP INI memory values to bytes + * + * @param string $value The value to convert + * + * @return int The bytes value + * @since 5.0.2 + */ + protected function convertToBytes(string $value): int + { + $value = trim($value); + $lastChar = strtolower($value[strlen($value) - 1]); + $numValue = substr($value, 0, -1); + + switch ($lastChar) + { + case 'g': + return $numValue * 1024 * 1024 * 1024; + case 'm': + return $numValue * 1024 * 1024; + case 'k': + return $numValue * 1024; + default: + return (int) $value; + } + } +} + diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFive/Settings.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFive/Settings.php index 1feea907d..93ca161bf 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFive/Settings.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFive/Settings.php @@ -351,7 +351,7 @@ final class Settings implements SettingsInterface $this->config->get('footable', false)) { $this->addImportViewFolder(); - $this->addPhpSpreadsheetFolder(); + // $this->addPhpSpreadsheetFolder(); // soon $this->addUikitFolder(); $this->addFooTableFolder(); } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFour/Settings.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFour/Settings.php index 15b900407..d2464794c 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFour/Settings.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/JoomlaFour/Settings.php @@ -351,7 +351,7 @@ final class Settings implements SettingsInterface $this->config->get('footable', false)) { $this->addImportViewFolder(); - $this->addPhpSpreadsheetFolder(); + // $this->addPhpSpreadsheetFolder(); // soon $this->addUikitFolder(); $this->addFooTableFolder(); } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index 09f6b8907..bed16d3f5 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -303,6 +303,24 @@ class Config extends BaseConfig } } + /** + * get component installer autoloader path + * + * @return string The component installer autoloader path + * @since 5.0.2 + */ + protected function getComponentinstallerautoloaderpath(): string + { + if ($this->joomla_version == 3) + { + return 'script_powerloader.php'; + } + else + { + return ucfirst($this->component_codename) . 'InstallerPowerloader.php'; + } + } + /** * get add namespace prefix * diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php index 32813feb3..912f2a7a7 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Interpretation.php @@ -1160,8 +1160,7 @@ class Interpretation extends Fields $newJ['component_version'] = CFactory::_('Component')->get('component_version'); // update the component with the new dynamic SQL - $modelJ = ComponentbuilderHelper::getModel('joomla_component'); - $modelJ->save($newJ); // <-- to insure the history is also updated + CFactory::_('Data.Item')->table('joomla_component')->set((object) $newJ, 'id'); // <-- to insure the history is also updated // reset the watch here CFactory::_('History')->get('joomla_component', CFactory::_('Config')->component_id); @@ -1175,10 +1174,9 @@ class Interpretation extends Fields { $newU['joomla_component'] = (int) CFactory::_('Config')->component_id; } - $newU['version_update'] = json_encode($buket); + $newU['version_update'] = $buket; // update the component with the new dynamic SQL - $modelU = ComponentbuilderHelper::getModel('component_updates'); - $modelU->save($newU); // <-- to insure the history is also updated + CFactory::_('Data.Item')->table('component_updates')->set((object) $newU, 'id'); // <-- to insure the history is also updated } } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php index 6cd432514..0d82efd67 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php @@ -228,11 +228,6 @@ final class Header implements HeaderInterface // get dynamic headers switch ($context) { - case 'admin.helper': - case 'site.helper': - $this->setHelperClassHeader($headers, $codeName); - break; - case 'admin.view.html': case 'admin.views.html': case 'custom.admin.view.html': @@ -560,26 +555,6 @@ final class Header implements HeaderInterface $this->headers[$context] = $headers; return $headers; - } - - /** - * set Helper Dynamic Headers - * - * @param array $headers The headers array - * @param string $target_client - * - * @return void - * @since 3.2.0 - */ - protected function setHelperClassHeader(&$headers, $target_client) - { - // add only to admin client - if ('admin' === $target_client && $this->config->get('add_eximport', false)) - { - $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; - $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; - $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; - } } } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php index 807d5cdf4..5b5ab3b5d 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php @@ -228,11 +228,6 @@ final class Header implements HeaderInterface // get dynamic headers switch ($context) { - case 'admin.helper': - case 'site.helper': - $this->setHelperClassHeader($headers, $codeName); - break; - case 'admin.view.html': case 'admin.views.html': case 'custom.admin.view.html': @@ -560,26 +555,6 @@ final class Header implements HeaderInterface $this->headers[$context] = $headers; return $headers; - } - - /** - * set Helper Dynamic Headers - * - * @param array $headers The headers array - * @param string $target_client - * - * @return void - * @since 3.2.0 - */ - protected function setHelperClassHeader(&$headers, $target_client) - { - // add only to admin client - if ('admin' === $target_client && $this->config->get('add_eximport', false)) - { - $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; - $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; - $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; - } } } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php index d26e3b163..f91ec8913 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php @@ -51,6 +51,14 @@ class Autoloader */ protected Content $content; + /** + * Installer Class Autoloader + * + * @var string + * @since 5.0.2 + **/ + protected string $installerhelper = ''; + /** * Helper Class Autoloader * @@ -77,6 +85,7 @@ class Autoloader // reset all autoloaders power placeholders $this->content->set('ADMIN_POWER_HELPER', ''); $this->content->set('SITE_POWER_HELPER', ''); + $this->content->set('INSTALLER_POWER_HELPER', ''); $this->content->set('PLUGIN_POWER_AUTOLOADER', ''); $this->content->set('SITE_PLUGIN_POWER_AUTOLOADER', ''); $this->content->set('POWER_AUTOLOADER', ''); @@ -89,6 +98,7 @@ class Autoloader $this->content->set('SITE_TWO_POWER_AUTOLOADER', ''); $this->content->set('SITE_THREE_POWER_AUTOLOADER', ''); $this->content->set('SITE_FOUR_POWER_AUTOLOADER', ''); + $this->content->set('INSTALLER_POWER_AUTOLOADER_ARRAY', ''); } /** @@ -118,6 +128,9 @@ class Autoloader // to add to custom files $this->content->add('POWER_AUTOLOADER', $this->getAutoloaderFile(0)); $this->content->add('SITE_POWER_AUTOLOADER', $this->getAutoloaderFile(0, 'JPATH_SITE')); + + // to add to install file + $this->content->add('INSTALLER_POWER_AUTOLOADER_ARRAY', $this->getAutoloaderInstallArray()); } /** @@ -147,20 +160,23 @@ class Autoloader uksort($this->power->namespace, fn($a, $b) => strlen((string) $b) - strlen((string) $a)); // load to admin helper class - $this->content->add('ADMIN_POWER_HELPER', $this->getHelperAutoloader()); + $this->content->add('ADMIN_POWER_HELPER', $this->getAutoloaderCode()); // load to site helper class if needed - $this->content->add('SITE_POWER_HELPER', $this->getHelperAutoloader()); + $this->content->add('SITE_POWER_HELPER', $this->getAutoloaderCode()); + + // load to installer helper class if needed + $this->content->add('INSTALLER_POWER_HELPER', $this->getAutoloaderInstallerCode()); } } /** - * Get helper autoloader code + * Get autoloader code * * @return string * @since 3.2.0 */ - private function getHelperAutoloader(): string + private function getAutoloaderCode(): string { // check if it was already build if (!empty($this->helper)) @@ -172,13 +188,13 @@ class Autoloader $code = []; // add the composer stuff here - if (($script = $this->getComposer(0)) !== null) + if (($script = $this->getComposer()) !== null) { $code[] = $script; } // get the helper autoloader - if (($script = $this->getAutoloader(0)) !== null) + if (($script = $this->getAutoloader()) !== null) { $code[] = $script; } @@ -203,7 +219,7 @@ class Autoloader */ private function getAutoloaderFile(int $tabSpace, string $area = 'JPATH_ADMINISTRATOR'): ?string { - // we start building the autoloaded file loader + // we start building the autoloader file loader $autoload_file = []; $autoload_file[] = Indent::_($tabSpace) . '//' . Line::_(__Line__, __Class__) . " The power autoloader for this project ($area) area."; @@ -221,23 +237,21 @@ class Autoloader /** * Get autoloader code * - * @param int $tabSpace The dynamic tab spacer - * * @return string|null * @since 3.2.0 */ - private function getAutoloader(int $tabSpace): ?string + private function getAutoloader(): ?string { if (($size = ArrayHelper::check($this->power->namespace)) > 0) { // we start building the spl_autoload_register function call $autoload_method = []; - $autoload_method[] = Indent::_($tabSpace) . '//' + $autoload_method[] = '//' . Line::_(__Line__, __Class__) . ' register additional namespace'; - $autoload_method[] = Indent::_($tabSpace) . 'spl_autoload_register(function ($class) {'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + $autoload_method[] = 'spl_autoload_register(function ($class) {'; + $autoload_method[] = Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$search = ['; + $autoload_method[] = Indent::_(1) . '$search = ['; // counter to manage the comma in the actual array $counter = 1; @@ -246,63 +260,63 @@ class Autoloader // don't add the ending comma on last value if ($size == $counter) { - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + $autoload_method[] = Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; } else { - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + $autoload_method[] = Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; } $counter++; } - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '];'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// Start the search and load if found'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found = false;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_base_dir = "";'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_len = 0;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' + $autoload_method[] = Indent::_(1) . '];'; + $autoload_method[] = Indent::_(1) . '// Start the search and load if found'; + $autoload_method[] = Indent::_(1) . '$found = false;'; + $autoload_method[] = Indent::_(1) . '$found_base_dir = "";'; + $autoload_method[] = Indent::_(1) . '$found_len = 0;'; + $autoload_method[] = Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoload_method[] = Indent::_(1) . '{'; + $autoload_method[] = Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '$len = strlen($prefix);'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '{'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' + $autoload_method[] = Indent::_(2) . '$len = strlen($prefix);'; + $autoload_method[] = Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoload_method[] = Indent::_(2) . '{'; + $autoload_method[] = Indent::_(3) . '//' . Line::_(__Line__, __Class__) . ' we have a match so load the values'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found = true;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_base_dir = $base_dir;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_len = $len;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' + $autoload_method[] = Indent::_(3) . '$found = true;'; + $autoload_method[] = Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoload_method[] = Indent::_(3) . '$found_len = $len;'; + $autoload_method[] = Indent::_(3) . '//' . Line::_(__Line__, __Class__) . ' done here'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . 'break;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '}'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_(3) . 'break;'; + $autoload_method[] = Indent::_(2) . '}'; + $autoload_method[] = Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + $autoload_method[] = Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' check if we found a match'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (!$found)'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_(1) . 'if (!$found)'; + $autoload_method[] = Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' + $autoload_method[] = Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' not found so move to the next registered autoloader'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'return;'; + $autoload_method[] = Indent::_(2) . 'return;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + $autoload_method[] = Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' get the relative class name'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + $autoload_method[] = Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoload_method[] = Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// with .php'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + $autoload_method[] = Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoload_method[] = Indent::_(1) . '// with .php'; + $autoload_method[] = Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoload_method[] = Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' if the file exists, require it'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (file_exists($file))'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'require $file;'; - $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tabSpace) . '});'; + $autoload_method[] = Indent::_(1) . 'if (file_exists($file))'; + $autoload_method[] = Indent::_(1) . '{'; + $autoload_method[] = Indent::_(2) . 'require $file;'; + $autoload_method[] = Indent::_(1) . '}'; + $autoload_method[] = '});'; return implode(PHP_EOL, $autoload_method); } @@ -313,12 +327,10 @@ class Autoloader /** * Get the composer autoloader routine * - * @param int $tabSpace The dynamic tab spacer - * * @return string|null * @since 3.2.0 */ - private function getComposer(int $tabSpace): ?string + private function getComposer(): ?string { if (ArrayHelper::check($this->power->composer)) { @@ -332,11 +344,11 @@ class Autoloader // don't add the ending comma on last value if (empty($add_once[$access_point])) { - $composer_routine[] = Indent::_($tabSpace) . "\$composer_autoloader = JPATH_LIBRARIES . '/$access_point';"; - $composer_routine[] = Indent::_($tabSpace) . 'if (file_exists($composer_autoloader))'; - $composer_routine[] = Indent::_($tabSpace) . "{"; - $composer_routine[] = Indent::_($tabSpace) . Indent::_(1) . 'require_once $composer_autoloader;'; - $composer_routine[] = Indent::_($tabSpace) . "}"; + $composer_routine[] = "\$composer_autoloader = JPATH_LIBRARIES . '/$access_point';"; + $composer_routine[] = 'if (file_exists($composer_autoloader))'; + $composer_routine[] = "{"; + $composer_routine[] = Indent::_(1) . 'require_once $composer_autoloader;'; + $composer_routine[] = "}"; $add_once[$access_point] = true; } @@ -345,12 +357,209 @@ class Autoloader // this is just about the [autoloader or autoloaders] in the comment ;) if (count($add_once) == 1) { - array_unshift($composer_routine, Indent::_($tabSpace) . '//' + array_unshift($composer_routine, '//' . Line::_(__Line__, __Class__) . ' add the autoloader for the composer classes'); } else { - array_unshift($composer_routine, Indent::_($tabSpace) . '//' + array_unshift($composer_routine, '//' + . Line::_(__Line__, __Class__) . ' add the autoloaders for the composer classes'); + } + + return implode(PHP_EOL, $composer_routine); + } + + return null; + } + + /** + * Get autoloaders for install file + * + * @return string + * @since 5.0.2 + */ + private function getAutoloaderInstallArray(): string + { + // we start building the autoloader file loader + $autoload_file = []; + $autoload_file[] = PHP_EOL . Indent::_(3) . "__DIR__ . '/" . + $this->config->get('component_installer_autoloader_path', 'ERROR') . "',"; + $autoload_file[] = Indent::_(3) . "JPATH_ADMINISTRATOR . '/components/com_" + . $this->config->get('component_code_name', 'ERROR') . '/' + . $this->config->get('component_autoloader_path', 'ERROR') . "'" . PHP_EOL . Indent::_(2); + + return implode(PHP_EOL, $autoload_file); + } + + /** + * Get installer autoloader code + * + * @return string + * @since 5.0.2 + */ + private function getAutoloaderInstallerCode(): string + { + // check if it was already build + if (!empty($this->installerhelper)) + { + return $this->installerhelper; + } + + // load the code + $code = []; + + // add the composer stuff here + // if (($script = $this->getInstallerComposer()) !== null) + // { + // $code[] = $script; + // } + + // get the helper autoloader + if (($script = $this->getInstallerAutoloader()) !== null) + { + $code[] = $script; + } + + // if we have any + if (!empty($code)) + { + $this->installerhelper = PHP_EOL . PHP_EOL . implode(PHP_EOL . PHP_EOL, $code); + } + + return $this->installerhelper; + } + + /** + * Get autoloader code + * + * + * @return string|null + * @since 3.2.0 + */ + private function getInstallerAutoloader(): ?string + { + if (($size = ArrayHelper::check($this->power->namespace)) > 0) + { + // we start building the spl_autoload_register function call + $autoload_method = []; + $autoload_method[] = '//' + . Line::_(__Line__, __Class__) . ' register additional namespace'; + $autoload_method[] = 'spl_autoload_register(function ($class) {'; + $autoload_method[] = Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; + $autoload_method[] = Indent::_(1) . '$search = ['; + + // counter to manage the comma in the actual array + $counter = 1; + foreach ($this->power->namespace as $base_dir => $prefix) + { + // don't add the ending comma on last value + if ($size == $counter) + { + $autoload_method[] = Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + } + else + { + $autoload_method[] = Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + } + $counter++; + } + $autoload_method[] = Indent::_(1) . '];'; + $autoload_method[] = Indent::_(1) . '// Start the search and load if found'; + $autoload_method[] = Indent::_(1) . '$found = false;'; + $autoload_method[] = Indent::_(1) . '$found_base_dir = "";'; + $autoload_method[] = Indent::_(1) . '$found_len = 0;'; + $autoload_method[] = Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoload_method[] = Indent::_(1) . '{'; + $autoload_method[] = Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; + $autoload_method[] = Indent::_(2) . '$len = strlen($prefix);'; + $autoload_method[] = Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoload_method[] = Indent::_(2) . '{'; + $autoload_method[] = Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' we have a match so load the values'; + $autoload_method[] = Indent::_(3) . '$found = true;'; + $autoload_method[] = Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoload_method[] = Indent::_(3) . '$found_len = $len;'; + $autoload_method[] = Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' done here'; + $autoload_method[] = Indent::_(3) . 'break;'; + $autoload_method[] = Indent::_(2) . '}'; + $autoload_method[] = Indent::_(1) . '}'; + + $autoload_method[] = Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' check if we found a match'; + $autoload_method[] = Indent::_(1) . 'if (!$found)'; + $autoload_method[] = Indent::_(1) . '{'; + + $autoload_method[] = Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' not found so move to the next registered autoloader'; + $autoload_method[] = Indent::_(2) . 'return;'; + + $autoload_method[] = Indent::_(1) . '}'; + + $autoload_method[] = Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' get the relative class name'; + $autoload_method[] = Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoload_method[] = Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; + $autoload_method[] = Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoload_method[] = Indent::_(1) . '// with .php'; + $autoload_method[] = Indent::_(1) . "\$file = __DIR__ . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoload_method[] = Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' if the file exists, require it'; + $autoload_method[] = Indent::_(1) . 'if (file_exists($file))'; + $autoload_method[] = Indent::_(1) . '{'; + $autoload_method[] = Indent::_(2) . 'require $file;'; + $autoload_method[] = Indent::_(1) . '}'; + $autoload_method[] = '});'; + + return implode(PHP_EOL, $autoload_method); + } + + return null; + } + + /** + * Get the composer autoloader routine (NOT READY) + * + * + * @return string|null + * @since 3.2.0 + */ + private function getInstallerComposer(): ?string + { + if (ArrayHelper::check($this->power->composer)) + { + // load the composer routine + $composer_routine = []; + + // counter to manage the comma in the actual array + $add_once = []; + foreach ($this->power->composer as $access_point) + { + // don't add the ending comma on last value + if (empty($add_once[$access_point])) + { + $composer_routine[] = "\$composer_autoloader = __DIR__ . '/libraries/$access_point';"; + $composer_routine[] = 'if (file_exists($composer_autoloader))'; + $composer_routine[] = "{"; + $composer_routine[] = Indent::_(1) . 'require_once $composer_autoloader;'; + $composer_routine[] = "}"; + + $add_once[$access_point] = true; + } + } + + // this is just about the [autoloader or autoloaders] in the comment ;) + if (count($add_once) == 1) + { + array_unshift($composer_routine, '//' + . Line::_(__Line__, __Class__) . ' add the autoloader for the composer classes'); + } + else + { + array_unshift($composer_routine, '//' . Line::_(__Line__, __Class__) . ' add the autoloaders for the composer classes'); } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/PHPConfigurationChecker.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/PHPConfigurationChecker.php new file mode 100644 index 000000000..74903fd5a --- /dev/null +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/PHPConfigurationChecker.php @@ -0,0 +1,88 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder; + + +use VDM\Joomla\Interfaces\PHPConfigurationCheckerInterface; +use VDM\Joomla\Abstraction\PHPConfigurationChecker as ExtendingPHPConfigurationChecker; + + +/** + * Componentbuilder PHP Configuration Checker + * + * @since 3.2.2 + */ +final class PHPConfigurationChecker extends ExtendingPHPConfigurationChecker implements PHPConfigurationCheckerInterface +{ + /** + * The upload max filesize value + * + * @var string + * @since 5.0.2 + **/ + protected string $upload_max_filesize = '128M'; + + /** + * The post max size value + * + * @var string + * @since 5.0.2 + **/ + protected string $post_max_size = '128M'; + + /** + * The max execution time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_execution_time = 60; + + /** + * The max input vars value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_vars = 7000; + + /** + * The max input time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_time = 60; + + /** + * The memory limit value + * + * @var string + * @since 5.0.2 + **/ + protected string $memory_limit = '256M'; + + /** + * Constructor. + * + * @since 5.0.2 + */ + public function __construct($app = null) + { + parent::__construct($app); + + // set the required PHP Configures + $this->set('environment.name', 'Componentbuilder environment'); + $this->set('environment.wiki_url', 'git.vdm.dev/joomla/Component-Builder/wiki/PHP-Settings'); + } +} + diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php b/libraries/vendor_jcb/VDM.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php new file mode 100644 index 000000000..5b0667188 --- /dev/null +++ b/libraries/vendor_jcb/VDM.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php @@ -0,0 +1,30 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Interfaces; + + +/** + * PHP Configuration Checker + * + * @since 5.0.2 + */ +interface PHPConfigurationCheckerInterface +{ + /** + * Check that the required configurations are set for PHP + * + * @return void + * @since 5.0.2 + **/ + public function run(): void; +} +