From 137bde87a4ca4fa8258a32171fac776ccf485fd2 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 31 Jan 2018 15:35:54 +0200 Subject: [PATCH] Updated paypal link in readme. Added new function to include code from online source url. --- README.md | 12 +-- admin/README.txt | 12 +-- admin/helpers/compiler/a_Get.php | 99 +++++++++++++++++-- .../en-GB/en-GB.com_componentbuilder.ini | 2 +- admin/sql/install.mysql.utf8.sql | 6 ++ admin/sql/updates/mysql/2.6.13.sql | 5 + componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 ++++ script.php | 2 +- 9 files changed, 134 insertions(+), 27 deletions(-) create mode 100644 admin/sql/updates/mysql/2.6.13.sql diff --git a/README.md b/README.md index 57fdadb96..404aa6bdd 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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.13) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.14) 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) @@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th January, 2018 -+ *Version*: 2.6.13 ++ *Last Build*: 31st January, 2018 ++ *Version*: 2.6.14 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **180838** ++ *Line count*: **180866** + *Field count*: **1577** -+ *File count*: **1161** ++ *File count*: **1162** + *Folder count*: **186** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). @@ -141,6 +141,6 @@ Component Builder is mapped as a component in itself on my local development env ## Donations Come on buy VDM a coffee :) - * PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) + * PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) * Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf * Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 \ No newline at end of file diff --git a/admin/README.txt b/admin/README.txt index 57fdadb96..404aa6bdd 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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.13) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.14) 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) @@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th January, 2018 -+ *Version*: 2.6.13 ++ *Last Build*: 31st January, 2018 ++ *Version*: 2.6.14 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **180838** ++ *Line count*: **180866** + *Field count*: **1577** -+ *File count*: **1161** ++ *File count*: **1162** + *Folder count*: **186** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). @@ -141,6 +141,6 @@ Component Builder is mapped as a component in itself on my local development env ## Donations Come on buy VDM a coffee :) - * PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) + * PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) * Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf * Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 \ No newline at end of file diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 9e2b2020a..fd681c6fa 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -144,7 +144,7 @@ class Get public $customCodeMemory = array(); /** - * The custom code in local files that aready exist in system + * The custom code in local files that already exist in system * * @var array */ @@ -164,6 +164,13 @@ class Get */ protected $codeAreadyDone = array(); + /** + * The online code to be added + * + * @var array + */ + protected $onlineCodeData = array(); + /* * The line numbers Switch * @@ -3651,19 +3658,90 @@ class Get { if (ComponentbuilderHelper::checkString($string)) { - return $this->setLangStrings($this->setCustomCodeData($string)); + return $this->setLangStrings($this->setCustomCodeData($this->setOnlineCodeData($string))); } return $string; } - + /** + * We start set the online code data & can load it in to string + * + * @param string $string The content to check + * + * @return string + * + */ + public function setOnlineCodeData($string) + { + // check if content has custom code place holder + if (strpos($string, '[ONLIN' . 'ECODE=') !== false) + { + // urls content + $bucket = array(); + $found = ComponentbuilderHelper::getAllBetween($string, '[ONLIN' . 'ECODE=', ']'); + if (ComponentbuilderHelper::checkArray($found)) + { + // build local bucket + foreach ($found as $url) + { + $key = '[ONLIN' . 'ECODE=' . $url . ']'; + $urlKey = trim($url); + // check if we already fethced this + if (!isset($this->onlineCodeData[$urlKey])) + { + // get the data string (code) + $this->onlineCodeData[$urlKey] = ComponentbuilderHelper::getFileContents($urlKey); + // did we get any value + if (ComponentbuilderHelper::checkString($this->onlineCodeData[$urlKey])) + { + // check for changes + $liveHash = md5($this->onlineCodeData[$urlKey]); + // check if it exist local + if ($hash = ComponentbuilderHelper::getVar('online_code', $urlKey, 'url', 'hash')) + { + if ($hash !== $liveHash) + { + $object = new stdClass(); + $object->url = $urlKey; + $object->hash = $liveHash; + // update local hash + $this->db->updateObject('#__componentbuilder_online_code', $object, 'url'); + // give notice of the change + $this->app->enqueueMessage(JText::sprintf('The code from %s has been changed since the last compilation, please investigate!', $urlKey), 'warning'); + } + } + else + { + // add the hash to track changes + $object = new stdClass(); + $object->url = $urlKey; + $object->hash = $liveHash; + // insert local hash + $this->db->insertObject('#__componentbuilder_online_code', $object); + } + } + } + // add to local bucket + if (ComponentbuilderHelper::checkString($this->onlineCodeData[$urlKey])) + { + $bucket[$key] = $this->onlineCodeData[$urlKey]; + } + } + // now update local string if bucket has values + if (ComponentbuilderHelper::checkArray($bucket)) + { + $string = $this->setPlaceholders($string, $bucket); + } + } + } + return $string; + } + /** * We start set the custom code data & can load it in to string * * @param string $string The content to check - * @param bool $insert Should we insert the code into the content - * @param bool $bool Should we return bool on success * - * @return string|bool based on sig + * @return string * */ public function setCustomCodeData($string) @@ -3690,11 +3768,11 @@ class Get $getFuncName = trim($key); if (!isset($this->functionNameMemory[$getFuncName])) { - if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) { continue; } - $this->functionNameMemory[$getFuncName] = $found; + $this->functionNameMemory[$getFuncName] = $found_local; } $id = (int) $this->functionNameMemory[$getFuncName]; } @@ -3711,11 +3789,11 @@ class Get $getFuncName = trim($array[0]); if (!isset($this->functionNameMemory[$getFuncName])) { - if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) { continue; } - $this->functionNameMemory[$getFuncName] = $found; + $this->functionNameMemory[$getFuncName] = $found_local; } $id = (int) $this->functionNameMemory[$getFuncName]; } @@ -4618,6 +4696,7 @@ class Get { // reset found comment type $commentType = 0; + $this->app->enqueueMessage(JText::sprintf('We found dynamic code all in one line, and ignored it! Please review (%s) for more details!', $path), 'warning'); continue; } // do a quick check to insure we have an id diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 49dc1b263..196710e44 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -4411,7 +4411,7 @@ Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### mo ## Donations

If you want to support this project, please consider donating:
- * PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
+ * PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 " diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 1fd2447e5..17a03fec5 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1634,6 +1634,12 @@ INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, (2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2017-12-25 12:40:16', 10, '', 2), (3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2017-12-25 12:38:24', 8, '', 3); +CREATE TABLE IF NOT EXISTS `#__componentbuilder_online_code` ( + `url` VARCHAR(255) NOT NULL DEFAULT '', + `hash` VARCHAR(64) NOT NULL DEFAULT '', + PRIMARY KEY (`url`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + -- diff --git a/admin/sql/updates/mysql/2.6.13.sql b/admin/sql/updates/mysql/2.6.13.sql new file mode 100644 index 000000000..d9cca7fb6 --- /dev/null +++ b/admin/sql/updates/mysql/2.6.13.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS `#__componentbuilder_online_code` ( + `url` VARCHAR(255) NOT NULL DEFAULT '', + `hash` VARCHAR(64) NOT NULL DEFAULT '', + PRIMARY KEY (`url`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; diff --git a/componentbuilder.xml b/componentbuilder.xml index 16688146c..666cb204d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 28th January, 2018 + 31st January, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://joomlacomponentbuilder.com Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.6.13 + 2.6.14 Component Builder (v.2.6.13) +

Component Builder (v.2.6.14)

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 6e100e139..94cba8316 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -390,4 +390,21 @@ http://joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.6.14 + http://joomlacomponentbuilder.com + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.14/JCB_v2.6.14.zip + + + stable + + Llewellyn van der Merwe + http://joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index 8e83c1ea5..4639c8a46 100644 --- a/script.php +++ b/script.php @@ -4739,7 +4739,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; } } }