diff --git a/.gitignore b/.gitignore
index dd2bf8f..d9eb1c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,2 @@
.idea
-.vscode
-.phing
-node_modules
-package-lock.json
\ No newline at end of file
+.test
\ No newline at end of file
diff --git a/README.md b/README.md
index fd44269..fffafb6 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,17 @@
-# JetBrains PhpStorm
-Various useful files for working in the JetBrains PhpStorm
\ No newline at end of file
+# JetBrains: PhpStorm
+
+![JetBrains: PhpStorm](https://repository-images.githubusercontent.com/99415866/b9e8a080-c05e-11e9-80cc-19c2e91b4dc1)
+Various useful files for working in the JetBrains PhpStorm
+
+[![Support](https://img.shields.io/github/issues-raw/SeptdirWorkshop/JetBrains-PhpStorm?style=for-the-badge&logoWidth=20&label=support)](https://github.com/SeptdirWorkshop/JetBrains-PhpStorm/issues)
+[![Download](https://img.shields.io/github/release/SeptdirWorkshop/JetBrains-PhpStorm.svg?style=for-the-badge&colorA=555&colorB=1e87f0&label=download)](https://github.com/SeptdirWorkshop/JetBrains-PhpStorm/releases/latest)
+
+## Package contents
+
+- **codeStyle** - Code formating style
+- **colors** - Code color scheme
+- **fileTemplates** - File templates for Joomla CMS and beyond
+- **options** - File names for templates
+- **project** - Template for an empty project including phing tasks
+- **templates** - Live Templates for files
+- **watchers** - Configuration for File Watcher
\ No newline at end of file
diff --git a/codestyles/Septdir.xml b/codestyles/Septdir.xml
index b472e7a..3cd852f 100644
--- a/codestyles/Septdir.xml
+++ b/codestyles/Septdir.xml
@@ -4,6 +4,7 @@
+
diff --git a/fileTemplates/Joomla - Component.xml b/fileTemplates/Joomla - Component.xml
deleted file mode 100644
index 72d940b..0000000
--- a/fileTemplates/Joomla - Component.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
- COM_${NAME.toUpperCase()}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- COM_${NAME.toUpperCase()}_DESCRIPTION
- script.php
-
-
- sql/install.mysql.utf8.sql
-
-
-
-
- sql/uninstall.mysql.utf8.sql
-
-
-
- controllers
- helpers
- models
- views
- controller.php
- ${NAME}.php
- router.php
-
-
- language/en-GB/en-GB.com_${NAME}.ini
- language/en-GB/en-GB.com_${NAME}.sys.ini
- language/ru-RU/ru-RU.com_${NAME}.ini
- language/ru-RU/ru-RU.com_${NAME}.sys.ini
-
-
-
-
-
-
-
- controllers
- helpers
- models
- sql
- tables
- views
- access.xml
- config.xml
- controller.php
- ${NAME}.php
-
-
- language/en-GB/en-GB.com_${NAME}.ini
- language/en-GB/en-GB.com_${NAME}.sys.ini
- language/ru-RU/ru-RU.com_${NAME}.ini
- language/ru-RU/ru-RU.com_${NAME}.sys.ini
-
-
-
- css
- js
- images
-
-
-
- https://site.com/update?extension=com_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.0.php b/fileTemplates/Joomla - Component.xml.child.0.php
deleted file mode 100644
index 3808aed..0000000
--- a/fileTemplates/Joomla - Component.xml.child.0.php
+++ /dev/null
@@ -1,4 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.21.html b/fileTemplates/Joomla - Component.xml.child.21.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.21.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.22.sql b/fileTemplates/Joomla - Component.xml.child.22.sql
deleted file mode 100644
index e69de29..0000000
diff --git a/fileTemplates/Joomla - Component.xml.child.23.sql b/fileTemplates/Joomla - Component.xml.child.23.sql
deleted file mode 100644
index e69de29..0000000
diff --git a/fileTemplates/Joomla - Component.xml.child.24.html b/fileTemplates/Joomla - Component.xml.child.24.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.24.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.25.php b/fileTemplates/Joomla - Component.xml.child.25.php
deleted file mode 100644
index 664c9d8..0000000
--- a/fileTemplates/Joomla - Component.xml.child.25.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.27.html b/fileTemplates/Joomla - Component.xml.child.27.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.27.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.28.html b/fileTemplates/Joomla - Component.xml.child.28.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.28.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.29.html b/fileTemplates/Joomla - Component.xml.child.29.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.29.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.3.html b/fileTemplates/Joomla - Component.xml.child.3.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.3.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.4.html b/fileTemplates/Joomla - Component.xml.child.4.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/Joomla - Component.xml.child.4.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.5.php b/fileTemplates/Joomla - Component.xml.child.5.php
deleted file mode 100644
index 3808aed..0000000
--- a/fileTemplates/Joomla - Component.xml.child.5.php
+++ /dev/null
@@ -1,4 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.7.ini b/fileTemplates/Joomla - Component.xml.child.7.ini
deleted file mode 100644
index 7f67abb..0000000
--- a/fileTemplates/Joomla - Component.xml.child.7.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-; Note : All ini files need to be saved as UTF-8
-
-COM_${NAME.toUpperCase()} = ""
-COM_${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.8.ini b/fileTemplates/Joomla - Component.xml.child.8.ini
deleted file mode 100644
index 7f67abb..0000000
--- a/fileTemplates/Joomla - Component.xml.child.8.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-; Note : All ini files need to be saved as UTF-8
-
-COM_${NAME.toUpperCase()} = ""
-COM_${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.9.ini b/fileTemplates/Joomla - Component.xml.child.9.ini
deleted file mode 100644
index 7f67abb..0000000
--- a/fileTemplates/Joomla - Component.xml.child.9.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-; Note : All ini files need to be saved as UTF-8
-
-COM_${NAME.toUpperCase()} = ""
-COM_${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - File.xml b/fileTemplates/Joomla - File.xml
deleted file mode 100644
index 475181a..0000000
--- a/fileTemplates/Joomla - File.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- ${name}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
-
-
-
-
-
-
-
- https://site.com/update?extension=com_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Languages.ini.child.0.ini b/fileTemplates/Joomla - Languages.ini.child.0.ini
deleted file mode 100644
index 99a77bb..0000000
--- a/fileTemplates/Joomla - Languages.ini.child.0.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-
-; Note : All ini files need to be saved as UTF-8
-
-${NAME.toUpperCase()} = ""
-${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Languages.ini.child.1.ini b/fileTemplates/Joomla - Languages.ini.child.1.ini
deleted file mode 100644
index 99a77bb..0000000
--- a/fileTemplates/Joomla - Languages.ini.child.1.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-
-; Note : All ini files need to be saved as UTF-8
-
-${NAME.toUpperCase()} = ""
-${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Languages.ini.child.2.ini b/fileTemplates/Joomla - Languages.ini.child.2.ini
deleted file mode 100644
index 99a77bb..0000000
--- a/fileTemplates/Joomla - Languages.ini.child.2.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-
-; Note : All ini files need to be saved as UTF-8
-
-${NAME.toUpperCase()} = ""
-${NAME.toUpperCase()}_DESCRIPTION = ""
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Library.xml b/fileTemplates/Joomla - Library.xml
deleted file mode 100644
index 7eaa476..0000000
--- a/fileTemplates/Joomla - Library.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- ${name}
- ${libraryName}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
-
- ${sourceLibraryName}
- ${NAME}.php
-
-
-
- https://site.com/update?extension=com_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Module.xml b/fileTemplates/Joomla - Module.xml
deleted file mode 100644
index 51ecc0e..0000000
--- a/fileTemplates/Joomla - Module.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
- ${LANGUAGE_CONSTANT}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
- en-GB/en-GB.${NAME}.ini
- en-GB/en-GB.${NAME}.sys.ini
- ru-RU/ru-RU.${NAME}.ini
- ru-RU/ru-RU.${NAME}.sys.ini
-
-
- ${NAME}.php
- tmpl
-
-
-
-
-
-
-
-
- css
- js
- images
-
-
-
- https://site.com/update?extension=${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Package.xml b/fileTemplates/Joomla - Package.xml
deleted file mode 100644
index efd9fc6..0000000
--- a/fileTemplates/Joomla - Package.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
- ${LANGUAGE_CONSTANT}
- ${packagename}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
- en-GB/en-GB.${NAME}.sys.ini
- ru-RU/ru-RU.${NAME}.sys.ini
-
-
- com_name
- mod_name
- plg_group_name
-
-
-
- https://site.com/update?extension=${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Plugin .xml b/fileTemplates/Joomla - Plugin .xml
deleted file mode 100644
index 909d313..0000000
--- a/fileTemplates/Joomla - Plugin .xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
- ${LANGUAGE_CONSTANT}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
- en-GB/en-GB.plg_${group}_${NAME}.ini
- en-GB/en-GB.plg_${group}_${NAME}.sys.ini
- ru-RU/ru-RU.plg_${group}_${NAME}.ini
- ru-RU/ru-RU.plg_${group}_${NAME}.sys.ini
-
-
- ${NAME}.php
-
-
-
-
-
-
-
- css
- js
- images
-
-
-
- https://site.com/update?extension=plg_${group}_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Template.xml b/fileTemplates/Joomla - Template.xml
deleted file mode 100644
index 7fe58a1..0000000
--- a/fileTemplates/Joomla - Template.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
- ${templateName}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
- en-GB/en-GB.tpl_${templateName}.ini
- en-GB/en-GB.tpl_${templateName}.sys.ini
- ru-RU/ru-RU.tpl_${templateName}.ini
- ru-RU/ru-RU.tpl_${templateName}.sys.ini
-
-
- css
- html
- images
- js
- favicon.ico
- helper.php
- index.php
- templateDetails.xml
-
-
- scripts
-
-
-
-
-
-
-
-
- https://site.com/update?extension=tpl_${templateName}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - View.php b/fileTemplates/Joomla - View.php
deleted file mode 100644
index 664c9d8..0000000
--- a/fileTemplates/Joomla - View.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
\ No newline at end of file
diff --git a/fileTemplates/Joomla - Component.xml.child.19.xml b/fileTemplates/[Joomla] Component - Access File.xml
similarity index 83%
rename from fileTemplates/Joomla - Component.xml.child.19.xml
rename to fileTemplates/[Joomla] Component - Access File.xml
index 7a21f31..fb7dc7d 100644
--- a/fileTemplates/Joomla - Component.xml.child.19.xml
+++ b/fileTemplates/[Joomla] Component - Access File.xml
@@ -1,5 +1,9 @@
+#set($extension = $component)
+#if(!$extension.startsWith("com_"))
+ #set($extension = "com_$extension")
+#end
-
+
diff --git a/fileTemplates/Joomla - Component.xml.child.18.xml b/fileTemplates/[Joomla] Component - Config File.xml
similarity index 66%
rename from fileTemplates/Joomla - Component.xml.child.18.xml
rename to fileTemplates/[Joomla] Component - Config File.xml
index 15655e6..0a9fea0 100644
--- a/fileTemplates/Joomla - Component.xml.child.18.xml
+++ b/fileTemplates/[Joomla] Component - Config File.xml
@@ -1,5 +1,10 @@
+#set($extension = $component)
+#if(!$extension.startsWith("com_"))
+ #set($extension = "com_$extension")
+#end
-
+
+
@@ -8,10 +13,9 @@
description="JCONFIG_PERMISSIONS_DESC">
-
\ No newline at end of file
+
diff --git a/fileTemplates/[Joomla] Form File.xml b/fileTemplates/[Joomla] Form File.xml
index 2dda7f2..71137a4 100644
--- a/fileTemplates/[Joomla] Form File.xml
+++ b/fileTemplates/[Joomla] Form File.xml
@@ -1,4 +1,4 @@
-
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Index File.html b/fileTemplates/[Joomla] Index File.html
deleted file mode 100644
index 3af6301..0000000
--- a/fileTemplates/[Joomla] Index File.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Install Script.php b/fileTemplates/[Joomla] Install Script.php
new file mode 100644
index 0000000..78fa6ab
--- /dev/null
+++ b/fileTemplates/[Joomla] Install Script.php
@@ -0,0 +1,575 @@
+#set($addToArray = "[]")
+#set($path_src = "$path['src']")
+#set($path_dest = "$path['dest']")
+#set($path_type = "$path['type']")
+set(InstallerScriptInterface::class,
+ new class (\$container->get(AdministratorApplication::class)) implements InstallerScriptInterface {
+ /**
+ * The application object
+ *
+ * @var AdministratorApplication
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected AdministratorApplication \$app;
+
+ /**
+ * The Database object.
+ *
+ * @var DatabaseDriver
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected DatabaseDriver \$db;
+
+ #if (${minimumJoomla})
+ /**
+ * Minimum Joomla version required to install the extension.
+ *
+ * @var string
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected string \$minimumJoomla = '${minimumJoomla}';
+
+ #end
+ #if (${minimumPhp})
+ /**
+ * Minimum PHP version required to install the extension.
+ *
+ * @var string
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected string \$minimumPhp = '${minimumPhp}';
+
+ #end
+ #if (${minimumMySQL})
+ /**
+ * Minimum MySQL version required to install the extension.
+ *
+ * @var string
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected string \$minimumMySQL = '${minimumMySQL}';
+
+ #end
+ #if (${minimumMariaDb})
+ /**
+ * Minimum MariaDb version required to install the extension.
+ *
+ * @var string
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected string \$minimumMariaDb = '${minimumMariaDb}';
+
+ #end
+ /**
+ * Language constant for errors.
+ *
+ * @var string
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected string \$constant = "${languageConstant}";
+
+ #if (${checkExtensionParams})
+ /**
+ * Extension params for check.
+ *
+ * @var array
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected array \$extensionParams = [];
+
+ #end
+ /**
+ * Update methods.
+ *
+ * @var array
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected array \$updateMethods = [];
+
+ /**
+ * Constructor.
+ *
+ * @param AdministratorApplication \$app The application object.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function __construct(AdministratorApplication \$app)
+ {
+ \$this->app = \$app;
+ \$this->db = Factory::getContainer()->get('DatabaseDriver');
+ }
+
+ /**
+ * Function called after the extension is installed.
+ *
+ * @param InstallerAdapter \$adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function install(InstallerAdapter \$adapter): bool
+ {
+ #if (${enablePlugin})
+ \$this->enablePlugin(\$adapter);
+ #end
+
+ return true;
+ }
+
+ /**
+ * Function called after the extension is updated.
+ *
+ * @param InstallerAdapter \$adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function update(InstallerAdapter \$adapter): bool
+ {
+ // Refresh media version
+ (new Version())->refreshMediaVersion();
+
+ return true;
+ }
+
+ /**
+ * Function called after the extension is uninstalled.
+ *
+ * @param InstallerAdapter \$adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function uninstall(InstallerAdapter \$adapter): bool
+ {
+ return true;
+ }
+
+ /**
+ * Function called before extension installation/update/removal procedure commences.
+ *
+ * @param string \$type The type of change (install or discover_install, update, uninstall)
+ * @param InstallerAdapter \$adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function preflight(string \$type, InstallerAdapter \$adapter): bool
+ {
+ #if(${minimumJoomla} || ${minimumPhp} || ${minimumMySQL} || ${minimumMariaDb})
+ // Check compatible
+ if (!\$this->checkCompatible())
+ {
+ return false;
+ }
+
+ #end
+ return true;
+ }
+
+ /**
+ * Function called after extension installation/update/removal procedure commences.
+ *
+ * @param string \$type The type of change (install or discover_install, update, uninstall)
+ * @param InstallerAdapter \$adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function postflight(string \$type, InstallerAdapter \$adapter): bool
+ {
+ if (\$type !== 'uninstall')
+ {
+ #if (${parseLayouts})
+ // Parse layouts
+ \$this->parseLayouts(\$installer->getManifest()->layouts, \$installer);
+
+ #end
+ #if (${checkTables})
+ // Check databases
+ \$this->checkTables(\$adapter);
+
+ #end
+ #if (${checkRootRecord})
+ // Check root record
+ \$this->checkRootRecord('${checkRootRecord}');
+
+ #end
+ #if (${checkExtensionParams})
+ // Check extension params
+ \$this->checkExtensionParams(\$adapter);
+
+ #end
+ // Run updates script
+ if (\$type === 'update')
+ {
+ foreach (\$this->updateMethods as \$method)
+ {
+ if (method_exists(\$this, \$method))
+ {
+ \$this->\$method(\$adapter);
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ #if (${enablePlugin})
+ /**
+ * Enable plugin after installation.
+ *
+ * @param InstallerAdapter \$adapter Parent object calling object.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function enablePlugin(InstallerAdapter \$adapter)
+ {
+ // Prepare plugin object
+ \$plugin = new \stdClass();
+ \$plugin->type = 'plugin';
+ \$plugin->element = \$adapter->getElement();
+ \$plugin->folder = (string) \$adapter->getParent()->manifest->attributes()['group'];
+ \$plugin->enabled = 1;
+
+ // Update record
+ \$this->db->updateObject('#__extensions', \$plugin, ['type', 'element', 'folder']);
+ }
+
+ #end
+ #if(${minimumJoomla} || ${minimumPhp} || ${minimumMySQL} || ${minimumMariaDb})
+ /**
+ * Method to check compatible.
+ *
+ * @throws \Exception
+ *
+ * @return bool True on success, False on failure.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function checkCompatible(): bool
+ {
+ \$app = Factory::getApplication();
+
+ #if (${minimumJoomla})
+ // Check joomla version
+ if (!(new Version())->isCompatible(\$this->minimumJoomla))
+ {
+ \$app->enqueueMessage(Text::sprintf(\$constant . '_ERROR_COMPATIBLE_JOOMLA', \$this->minimumJoomla),
+ 'error');
+
+ return false;
+ }
+
+ #end
+ #if (${minimumPhp})
+ // Check PHP
+ if (!(version_compare(PHP_VERSION, \$this->minimumPhp) >= 0))
+ {
+ \$app->enqueueMessage(Text::sprintf(\$constant . '_ERROR_COMPATIBLE_PHP', \$this->minimumPhp),
+ 'error');
+
+ return false;
+ }
+
+ #end
+ #if (${minimumMySQL} || ${minimumMariaDb})
+ // Check database version
+ \$db = \$this->db;
+ \$serverType = \$db->getServerType();
+ \$serverVersion = \$db->getVersion();
+ #end
+ #if (${minimumMySQL})
+ if (\$serverType == 'mysql' && stripos(\$serverVersion, 'mariadb') !== false)
+ {
+ \$serverVersion = preg_replace('/^5\.5\.5-/', '', \$serverVersion);
+
+ if (!(version_compare(\$serverVersion, \$this->minimumMariaDb) >= 0))
+ {
+ \$app->enqueueMessage(Text::sprintf(\$constant . '_ERROR_COMPATIBLE_DATABASE',
+ \$this->minimumMySQL, \$this->minimumMariaDb), 'error');
+
+ return false;
+ }
+ }
+
+ #end
+ #if (${minimumMariaDb})
+ if (\$serverType == 'mysql' && !(version_compare(\$serverVersion, \$this->minimumMySQL) >= 0))
+ {
+ \$app->enqueueMessage(Text::sprintf(\$constant . '_ERROR_COMPATIBLE_DATABASE',
+ \$this->minimumMySQL, \$this->minimumMariaDb), 'error');
+
+ return false;
+ }
+
+ #end
+ return true;
+ }
+
+ #end
+ #if (${parseLayouts})
+ /**
+ * Method to parse through a layouts element of the installation manifest and take appropriate action.
+ *
+ * @param SimpleXMLElement|null \$element The XML node to process.
+ * @param Installer|null \$installer Installer calling object.
+ *
+ * @return bool True on success.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ public function parseLayouts(SimpleXMLElement \$element = null, Installer \$installer = null): bool
+ {
+ if (!\$element || !count(\$element->children()))
+ {
+ return false;
+ }
+
+ // Get destination
+ \$folder = ((string) \$element->attributes()->destination) ? '/' . \$element->attributes()->destination : null;
+ \$destination = Path::clean(JPATH_ROOT . '/layouts' . \$folder);
+
+ // Get source
+ \$folder = (string) \$element->attributes()->folder;
+ \$source = (\$folder && file_exists(\$installer->getPath('source') . '/' . \$folder))
+ ? \$installer->getPath('source') . '/' . \$folder : \$installer->getPath('source');
+
+ // Prepare files
+ \$copyFiles = [];
+ foreach (\$element->children() as \$file)
+ {
+ $path_src = Path::clean(\$source . '/' . \$file);
+ $path_dest = Path::clean(\$destination . '/' . \$file);
+
+ // Is this path a file or folder?
+ $path_type = \$file->getName() === 'folder' ? 'folder' : 'file';
+ if (basename($path_dest) !== $path_dest)
+ {
+ \$newdir = dirname($path_dest);
+ if (!Folder::create(\$newdir))
+ {
+ Log::add(Text::sprintf('JLIB_INSTALLER_ERROR_CREATE_DIRECTORY', \$newdir), Log::WARNING, 'jerror');
+
+ return false;
+ }
+ }
+
+ \$copyFiles$addToArray = \$path;
+ }
+
+ return \$installer->copyFiles(\$copyFiles, true);
+ }
+
+ #end
+ #if (${checkTables})
+ /**
+ * Method to create database tables in not exist.
+ *
+ * @param InstallerAdapter \$adapter Parent object calling object.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function checkTables(InstallerAdapter \$adapter)
+ {
+ if (\$sql = file_get_contents(\$adapter->getParent()->getPath('extension_administrator')
+ . '/sql/install.mysql.utf8.sql'))
+ {
+ \$db = \$this->db;
+ foreach (\$db->splitSql(\$sql) as \$query)
+ {
+ \$db->setQuery(\$db->convertUtf8mb4QueryToUtf8(\$query));
+ try
+ {
+ \$db->execute();
+ }
+ catch (JDataBaseExceptionExecuting \$e)
+ {
+ Log::add(Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', \$e->getMessage()), Log::WARNING, 'jerror');
+ }
+ }
+ }
+ }
+
+ #end
+ #if (${checkRootRecord})
+ /**
+ * Method to create root record if don't exist.
+ *
+ * @param string|null \$table Table name.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function checkRootRecord(string \$table = null)
+ {
+ \$db = \$this->db;
+
+ // Get base categories
+ \$query = \$db->getQuery(true)
+ ->select('id')
+ ->from(\$table)
+ ->where('id = 1');
+ \$db->setQuery(\$query);
+
+ // Add root in not found
+ if (empty(\$db->loadResult()))
+ {
+ \$root = new \stdClass();
+ \$root->id = 1;
+ \$root->parent_id = 0;
+ \$root->lft = 0;
+ \$root->rgt = 1;
+ \$root->level = 0;
+ \$root->path = '';
+ \$root->alias = 'root';
+ \$root->type = 'category';
+ \$root->state = 1;
+
+ \$db->insertObject(\$table, \$root);
+ }
+ }
+
+ #end
+ #if (${checkExtensionParams})
+ /**
+ * Method to check extension params and set if needed.
+ *
+ * @param InstallerAdapter \$adapter Parent object calling object.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function checkExtensionParams(InstallerAdapter \$adapter)
+ {
+ if (!empty(\$this->extensionParams))
+ {
+ \$element = \$adapter->getElement();
+ \$folder = (string) \$adapter->getParent()->manifest->attributes()['group'];
+
+ // Get extension
+ \$db = \$this->db;
+ \$query = \$db->getQuery(true)
+ ->select(['extension_id', 'params'])
+ ->from(\$db->quoteName('#__extensions'))
+ ->where(\$db->quoteName('element') . ' = :element')
+ ->bind(':element', \$element);
+ if (!empty(\$folder))
+ {
+ \$query->where(\$db->quoteName('folder') . ' = :folder')
+ ->bind(':folder', \$folder);
+ }
+ if (\$extension = \$db->setQuery(\$query)->loadObject())
+ {
+ \$extension->params = new Registry(\$extension->params);
+
+ // Check params
+ \$needUpdate = false;
+ foreach (\$this->extensionParams as \$path => \$value)
+ {
+ if (!\$extension->params->exists(\$path))
+ {
+ \$needUpdate = true;
+ \$extension->params->set(\$path, \$value);
+ }
+ }
+
+ // Update
+ if (\$needUpdate)
+ {
+ \$extension->params = (string) \$extension->params;
+ \$db->updateObject('#__extensions', \$extension, 'extension_id');
+ }
+ }
+ }
+ }
+
+ #end
+ #if (${parseLayouts})
+ /**
+ * Method to parse through a layouts element of the installation manifest and remove the files that were installed.
+ *
+ * @param SimpleXMLElement|null \$element The XML node to process.
+ *
+ * @return bool True on success.
+ *
+ * @since __DEPLOY_VERSION__
+ */
+ protected function removeLayouts(SimpleXMLElement \$element = null): bool
+ {
+ if (!\$element || !count(\$element->children()))
+ {
+ return false;
+ }
+
+ // Get the array of file nodes to process
+ \$files = \$element->children();
+
+ // Get source
+ \$folder = ((string) \$element->attributes()->destination) ? '/' . \$element->attributes()->destination : null;
+ \$source = Path::clean(JPATH_ROOT . '/layouts' . \$folder);
+
+ // Process each file in the \$files array (children of \$tagName).
+ foreach (\$files as \$file)
+ {
+ \$path = Path::clean(\$source . '/' . \$file);
+
+ // Actually delete the files/folders
+ if (is_dir(\$path))
+ {
+ \$val = Folder::delete(\$path);
+ }
+ else
+ {
+ \$val = File::delete(\$path);
+ }
+
+ if (\$val === false)
+ {
+ Log::add('Failed to delete ' . \$path, Log::WARNING, 'jerror');
+
+ return false;
+ }
+ }
+
+ if (!empty(\$folder))
+ {
+ Folder::delete(\$source);
+ }
+
+ return true;
+ }
+ #end
+ });
+ }
+};
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Language File.ini b/fileTemplates/[Joomla] Language File.ini
deleted file mode 100644
index d062fad..0000000
--- a/fileTemplates/[Joomla] Language File.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-
-; Note : All ini files need to be saved as UTF-8
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Languages.ini b/fileTemplates/[Joomla] Languages.ini
new file mode 100644
index 0000000..4fccca1
--- /dev/null
+++ b/fileTemplates/[Joomla] Languages.ini
@@ -0,0 +1 @@
+#parse("[Joomla] Languages - File.ini")
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Languages.ini.child.0.ini b/fileTemplates/[Joomla] Languages.ini.child.0.ini
new file mode 100644
index 0000000..4fccca1
--- /dev/null
+++ b/fileTemplates/[Joomla] Languages.ini.child.0.ini
@@ -0,0 +1 @@
+#parse("[Joomla] Languages - File.ini")
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Languages.ini.child.1.ini b/fileTemplates/[Joomla] Languages.ini.child.1.ini
new file mode 100644
index 0000000..4fccca1
--- /dev/null
+++ b/fileTemplates/[Joomla] Languages.ini.child.1.ini
@@ -0,0 +1 @@
+#parse("[Joomla] Languages - File.ini")
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Languages.ini.child.2.ini b/fileTemplates/[Joomla] Languages.ini.child.2.ini
new file mode 100644
index 0000000..4fccca1
--- /dev/null
+++ b/fileTemplates/[Joomla] Languages.ini.child.2.ini
@@ -0,0 +1 @@
+#parse("[Joomla] Languages - File.ini")
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Manifests - Component.xml b/fileTemplates/[Joomla] Manifests - Component.xml
new file mode 100644
index 0000000..c53b95c
--- /dev/null
+++ b/fileTemplates/[Joomla] Manifests - Component.xml
@@ -0,0 +1,45 @@
+#set($prefix = "com")
+#set($extension_name = ${name})
+#set($packagename = "")
+#set($languages_sys = "")
+#set($namespace = "Joomla\Component")
+#set($layouts_destination = "components")
+#parse("[Joomla] Manifests - Header.xml")
+
+#parse("[Joomla] Manifests - Information.xml")
+
+
+ sql/install.mysql.utf8.sql
+
+
+
+
+ sql/uninstall.mysql.utf8.sql
+
+
+
+ forms
+ src
+ tmpl
+
+ #set($languages = "site")
+ #parse("[Joomla] Manifests - Languages.xml")
+
+
+
+ forms
+ presets
+ services
+ sql
+ src
+ tmpl
+ access.xml
+ config.xml
+
+ #set($languages = "admin")
+ #parse("[Joomla] Manifests - Languages.xml")
+
+ #parse("[Joomla] Manifests - Media.xml")
+ #parse("[Joomla] Manifests - Layouts.xml")
+ #parse("[Joomla] Manifests - Updates.xml")
+
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Manifests - Module.xml b/fileTemplates/[Joomla] Manifests - Module.xml
new file mode 100644
index 0000000..e076a8e
--- /dev/null
+++ b/fileTemplates/[Joomla] Manifests - Module.xml
@@ -0,0 +1,53 @@
+#set($prefix = "mod")
+#set($extension_name = ${name})
+#set($extension_client = "site")
+#if(${client})
+ #set($extension_client = ${client.toLowerCase()})
+#end
+#set($packagename = "")
+#set($namespace = "Joomla\Module")
+#set($languages = "language")
+#set($languages_sys = "")
+#parse("[Joomla] Manifests - Header.xml")
+
+ #parse("[Joomla] Manifests - Information.xml")
+ #parse("[Joomla] Manifests - Languages.xml")
+
+ src
+ services
+ tmpl
+
+
+
+
+
+
+
+ #parse("[Joomla] Manifests - Media.xml")
+ #parse("[Joomla] Manifests - Updates.xml")
+
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Manifests - Package.xml b/fileTemplates/[Joomla] Manifests - Package.xml
new file mode 100644
index 0000000..22a9645
--- /dev/null
+++ b/fileTemplates/[Joomla] Manifests - Package.xml
@@ -0,0 +1,47 @@
+#set($prefix = "pkg")
+#set($packagename = ${name})
+#set($extension_name = ${packagename})
+#set($languages_sys = "true")
+#set($namespace = "")
+#set($languages = "language")
+#set($languages_sys = "true")
+#parse("[Joomla] Manifests - Header.xml")
+
+ #parse("[Joomla] Manifests - Information.xml")
+ #parse("[Joomla] Manifests - Languages.xml")
+
+ #if(${componentName})
+ #set($pkg_extension_name = "com_${componentName.toLowerCase()}")
+ #set($pkg_extension = "com_${pkg_extension_name}")
+ $pkg_extension
+ #end
+ #if(${moduleName})
+ #set($pkg_extension_name = "${moduleName.toLowerCase()}")
+ #set($pkg_extension = "mod_${pkg_extension_name}")
+ #set($pkg_extension_client = "site")
+ #if(${moduleClient})
+ #set($pkg_extension_client = ${moduleClient.toLowerCase()})
+ #end
+ $pkg_extension
+ #end
+ #if(${pluginName})
+ #set($pkg_extension_name = "${pluginName.toLowerCase()}")
+ #set($pkg_extension_group = "system")
+ #if(${pluginGroup})
+ #set($pkg_extension_group = "${pluginGroup.toLowerCase()}")
+ #end
+ #set($pkg_extension = "plg_${pkg_extension_group}_${pkg_extension_name}")
+ $pkg_extension
+ #end
+ #if(${templateName})
+ #set($pkg_extension_name = "${templateName.toLowerCase()}")
+ #set($pkg_extension = "tpl_${pkg_extension_name}")
+ #set($pkg_extension_client = "site")
+ #if(${templateClient})
+ #set($pkg_extension_client = ${templateClient.toLowerCase()})
+ #end
+ $pkg_extension
+ #end
+
+ #parse("[Joomla] Manifests - Updates.xml")
+
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] Manifests - Plugin.xml b/fileTemplates/[Joomla] Manifests - Plugin.xml
new file mode 100644
index 0000000..71d27cc
--- /dev/null
+++ b/fileTemplates/[Joomla] Manifests - Plugin.xml
@@ -0,0 +1,33 @@
+#set($extension_name = ${name})
+#set($extension_group = ${group})
+#set($group_lower = ${extension_group.toLowerCase()})
+#set($group_upper = ${extension_group.toUpperCase()})
+#set($part = "")
+#set($group_camel = "")
+#foreach($part in $extension_group.split("_"))
+ #set($group_camel = $group_camel + $part.substring(0, 1).toUpperCase() + $part.substring(1))
+#end
+#set($prefix = "plg_${group_lower}")
+#set($packagename = "")
+#set($namespace = "Joomla\Plugin\\${group_camel}")
+#set($layouts_destination = "plugins/${group_lower}")
+#set($languages = "language")
+#set($languages_sys = "")
+#parse("[Joomla] Manifests - Header.xml")
+
+ #parse("[Joomla] Manifests - Information.xml")
+ #parse("[Joomla] Manifests - Languages.xml")
+
+ services
+ src
+
+
+
+
+
+
+ #parse("[Joomla] Manifests - Media.xml")
+ #parse("[Joomla] Manifests - Layouts.xml")
+ #parse("[Joomla] Manifests - Updates.xml")
+
\ No newline at end of file
diff --git a/fileTemplates/[Joomla] PHP File.php b/fileTemplates/[Joomla] PHP File.php
index 664c9d8..bde8db5 100644
--- a/fileTemplates/[Joomla] PHP File.php
+++ b/fileTemplates/[Joomla] PHP File.php
@@ -1,5 +1,5 @@
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/[Joomla][Component] Config File.xml b/fileTemplates/[Joomla][Component] Config File.xml
deleted file mode 100644
index 0022088..0000000
--- a/fileTemplates/[Joomla][Component] Config File.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
diff --git a/fileTemplates/[Joomla][Component] Manifest File.xml b/fileTemplates/[Joomla][Component] Manifest File.xml
deleted file mode 100644
index 408fdb8..0000000
--- a/fileTemplates/[Joomla][Component] Manifest File.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
- ${LANGUAGE_CONSTANT}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
-
- sql/install.mysql.utf8.sql
-
-
-
-
- sql/uninstall.mysql.utf8.sql
-
-
-
- controllers
- helpers
- models
- views
- controller.php
- ${NAME}.php
- router.php
-
-
- language/en-GB/en-GB.com_${NAME}.ini
- language/en-GB/en-GB.com_${NAME}.sys.ini
- language/ru-RU/ru-RU.com_${NAME}.ini
- language/ru-RU/ru-RU.com_${NAME}.sys.ini
-
-
-
-
-
-
-
- controllers
- helpers
- models
- sql
- tables
- views
- access.xml
- config.xml
- controller.php
- ${NAME}.php
-
-
- language/en-GB/en-GB.com_${NAME}.ini
- language/en-GB/en-GB.com_${NAME}.sys.ini
- language/ru-RU/ru-RU.com_${NAME}.ini
- language/ru-RU/ru-RU.com_${NAME}.sys.ini
-
-
-
- css
- js
- images
-
-
-
- https://site.com/update?extension=com_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/[Joomla][Library] Manifest File.xml b/fileTemplates/[Joomla][Library] Manifest File.xml
deleted file mode 100644
index 7eaa476..0000000
--- a/fileTemplates/[Joomla][Library] Manifest File.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- ${name}
- ${libraryName}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
-
- ${sourceLibraryName}
- ${NAME}.php
-
-
-
- https://site.com/update?extension=com_${NAME}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/[Joomla][Template] Manifest File.xml b/fileTemplates/[Joomla][Template] Manifest File.xml
deleted file mode 100644
index 7fe58a1..0000000
--- a/fileTemplates/[Joomla][Template] Manifest File.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
- ${templateName}
- ${author}
- ${creationDate}
- ${copyright}
- ${license}
- ${authorEmail}
- ${authorUrl}
- ${version}
- ${LANGUAGE_CONSTANT}_DESCRIPTION
-
- en-GB/en-GB.tpl_${templateName}.ini
- en-GB/en-GB.tpl_${templateName}.sys.ini
- ru-RU/ru-RU.tpl_${templateName}.ini
- ru-RU/ru-RU.tpl_${templateName}.sys.ini
-
-
- css
- html
- images
- js
- favicon.ico
- helper.php
- index.php
- templateDetails.xml
-
-
- scripts
-
-
-
-
-
-
-
-
- https://site.com/update?extension=tpl_${templateName}
-
-
-
\ No newline at end of file
diff --git a/fileTemplates/[WebPack] ECMAScript 6.es6 b/fileTemplates/[WebPack] ECMAScript 6.es6
deleted file mode 100644
index 9a390c3..0000000
--- a/fileTemplates/[WebPack] ECMAScript 6.es6
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";
\ No newline at end of file
diff --git a/fileTemplates/[WordPress] PHP File.php b/fileTemplates/[WordPress] PHP File.php
deleted file mode 100644
index c2d1798..0000000
--- a/fileTemplates/[WordPress] PHP File.php
+++ /dev/null
@@ -1,5 +0,0 @@
-0.25%",
- "not ie 11",
- "not op_mini all"
- ]
- }
- }
- ]
- ]
-}
\ No newline at end of file
diff --git "a/fileTemplates/[webpack] Config\340\274\217ext\340\274\217.config.js" "b/fileTemplates/[webpack] Config\340\274\217ext\340\274\217.config.js"
deleted file mode 100644
index ce5530b..0000000
--- "a/fileTemplates/[webpack] Config\340\274\217ext\340\274\217.config.js"
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// Web pack configuration
-//
-// ========================================================================
-
-const path = require('path');
-const TerserPlugin = require('terser-webpack-plugin');
-const ExtractCssChunks = require('extract-css-chunks-webpack-plugin')
-const {CleanWebpackPlugin} = require('clean-webpack-plugin');
-const webpack = require('webpack');
-
-function prepareEntry(source, mode) {
- const entry = {};
- Object.keys(source).forEach((k, i) => {
- let key = JSON.parse(JSON.stringify(k)).replace(/^js\//, ''),
- data = JSON.parse(JSON.stringify(source[k]));
-
- let bundle = (typeof data === 'object' && data.import) ? data : {import: data};
- bundle.filename = (bundle.filename) ? bundle.filename.replace(/^js\//, '') : key
- bundle.filename = 'js/' + bundle.filename;
- if (!/\.(js|clean|delete|skip)$/.test(bundle.filename)) bundle.filename += '.js';
- if (mode === 'production') bundle.filename = bundle.filename.replace('.js', '.min.js');
-
- let entrypoint = key.replace(/\.(.?)*$/, '');
- if (entry[entrypoint]) entrypoint = entrypoint + '_' + i;
-
- entry[entrypoint] = bundle;
- });
-
- return entry;
-}
-
-function webpackConfig(entry, publicPath, mode) {
- if (!publicPath) publicPath = './';
- if (!mode) mode = 'production';
-
- return {
- mode: (mode === 'production') ? 'production' : 'development',
- entry: prepareEntry(entry, mode),
- output: {
- path: path.resolve(__dirname, publicPath),
- },
- devtool: (mode === 'production') ? false : 'inline-source-map',
- optimization: {
- minimize: (mode === 'production'),
- minimizer: (mode === 'production') ? [
- new TerserPlugin({
- test: /\.js(\?.*)?$/i,
- cache: true,
- parallel: true,
- sourceMap: false,
- terserOptions: {
- compress: {
- pure_getters: true,
- unsafe_comps: true,
- unsafe: true,
- passes: 2,
- keep_fargs: false,
- drop_console: true
- },
- output: {
- beautify: false,
- comments: false,
- },
- },
- extractComments: false,
- }),
- ] : []
- },
- module: {
- rules: [
- {
- test: /\.(es6|js)$/,
- use: ['babel-loader'],
- },
- {
- test: /\.(css|saas|scss)$/,
- use: [
- ExtractCssChunks.loader,
- {
- loader: 'css-loader',
- options: {
- sourceMap: (mode !== 'production'),
- },
- },
- {
- loader: 'sass-loader',
- options: {
- sourceMap: (mode !== 'production'),
- },
- }
- ],
- },
- {
- test: /\.(woff|woff2)$/,
- use: [
- {
- loader: "file-loader",
- options: {
- name: '[name].[ext]',
- outputPath: 'fonts/',
- publicPath: '../fonts'
- }
- }
- ]
- },
- {
- test: /\.(gif|png|jpe?g|svg)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- name: '[name].[ext]',
- outputPath: 'images/',
- publicPath: '../images'
- }
- },
- {
- loader: 'image-webpack-loader',
- options: {}
- },
- ],
- }
- ]
- },
-
- plugins: [
- new CleanWebpackPlugin({
- cleanOnceBeforeBuildPatterns: [],
- cleanAfterEveryBuildPatterns: ['./**/*.clean', './**/*.delete', './**/*.skip'],
- }),
- new ExtractCssChunks({
- filename: (mode === 'production') ? 'css/[name].min.css' : 'css/[name].css',
- chunkFilename: (mode === 'production') ? 'css/[name].min.css' : 'css/[name].css',
- }),
- new webpack.ProgressPlugin({})
- ],
- }
-}
-
-module.exports = webpackConfig;
\ No newline at end of file
diff --git a/fileTemplates/[webpack] Package.json b/fileTemplates/[webpack] Package.json
deleted file mode 100644
index 0e31df4..0000000
--- a/fileTemplates/[webpack] Package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "${PROJECT_NAME}",
- "version": "${version}",
- "description": "${description}",
- "private": true,
- "scripts": {
- "project": "webpack --config"
- },
- "keywords": [],
- "author": "${author}",
- "license": "${license}",
- "dependencies": {
- },
- "devDependencies": {
- "@babel/core": "^7.10.5",
- "@babel/preset-env": "^7.10.4",
- "babel-loader": "^8.1.0",
- "clean-webpack-plugin": "^3.0.0",
- "css-loader": "^4.0.0",
- "extract-css-chunks-webpack-plugin": "^4.7.5",
- "file-loader": "^6.0.0",
- "image-webpack-loader": "^6.0.0",
- "replace-in-file-webpack-plugin": "^1.0.6",
- "sass": "^1.26.10",
- "sass-loader": "^9.0.2",
- "style-loader": "^1.2.1",
- "terser-webpack-plugin": "^3.0.8",
- "webpack": "^5.0.0-beta.22",
- "webpack-cli": "^4.0.0-beta.8"
- }
-}
\ No newline at end of file
diff --git a/fileTemplates/includes/Joomla Component InstallerScript.php b/fileTemplates/includes/Joomla Component InstallerScript.php
deleted file mode 100644
index e69de29..0000000
diff --git a/fileTemplates/Joomla - Languages.ini b/fileTemplates/includes/[Joomla] Languages - File.ini
similarity index 99%
rename from fileTemplates/Joomla - Languages.ini
rename to fileTemplates/includes/[Joomla] Languages - File.ini
index f99886a..2b9e635 100644
--- a/fileTemplates/Joomla - Languages.ini
+++ b/fileTemplates/includes/[Joomla] Languages - File.ini
@@ -1,4 +1,3 @@
-
; Note : All ini files need to be saved as UTF-8
${NAME.toUpperCase()} = ""
diff --git a/fileTemplates/includes/[Joomla] Manifests - Header.xml b/fileTemplates/includes/[Joomla] Manifests - Header.xml
new file mode 100644
index 0000000..1dae692
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Header.xml
@@ -0,0 +1,12 @@
+#set($name_lower = ${extension_name.toLowerCase()})
+#set($name_upper = ${extension_name.toUpperCase()})
+#set($part = "")
+#set($name_camel = "")
+#foreach($part in $name.split("_"))
+ #set($name_camel = $name_camel + $part.substring(0, 1).toUpperCase() + $part.substring(1))
+#end
+#set($prefix_lower = ${prefix.toLowerCase()})
+#set($prefix_upper = ${prefix.toUpperCase()})
+#set($constant = "${prefix_upper}_${name_upper}")
+#set($extension = "${prefix_lower}_${name_lower}")
+
\ No newline at end of file
diff --git a/fileTemplates/includes/[Joomla] Manifests - Information.xml b/fileTemplates/includes/[Joomla] Manifests - Information.xml
new file mode 100644
index 0000000..4d81b69
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Information.xml
@@ -0,0 +1,16 @@
+$constant
+#if($packagename)
+ $packagename
+#end
+${author}
+${creationDate}
+${copyright}
+${license}
+${authorEmail}
+${authorUrl}
+${version}
+${constant}_DESCRIPTION
+#if($namespace)
+ $namespace\\$name_camel
+#end
+script.php
\ No newline at end of file
diff --git a/fileTemplates/includes/[Joomla] Manifests - Languages.xml b/fileTemplates/includes/[Joomla] Manifests - Languages.xml
new file mode 100644
index 0000000..e84869d
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Languages.xml
@@ -0,0 +1,10 @@
+
+ #if (!${languages_sys})
+ language/en-GB/en-GB.${extension}.ini
+ #end
+ language/en-GB/en-GB.${extension}.sys.ini
+ #if (!${languages_sys})
+ language/ru-RU/ru-RU.${extension}.ini
+ #end
+ language/ru-RU/ru-RU.${extension}.sys.ini
+
\ No newline at end of file
diff --git a/fileTemplates/includes/[Joomla] Manifests - Layouts.xml b/fileTemplates/includes/[Joomla] Manifests - Layouts.xml
new file mode 100644
index 0000000..bd6a5c9
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Layouts.xml
@@ -0,0 +1,4 @@
+#if (${layouts})
+
+
+#end
\ No newline at end of file
diff --git a/fileTemplates/includes/[Joomla] Manifests - Media.xml b/fileTemplates/includes/[Joomla] Manifests - Media.xml
new file mode 100644
index 0000000..7b942b0
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Media.xml
@@ -0,0 +1,14 @@
+#if (${media})
+
+ #if($media.contains("css"))
+ css
+ #end
+ #if($media.contains("js"))
+ js
+ #end
+ #if($media.contains("im"))
+ images
+ #end
+ joomla.asset.json
+
+#end
\ No newline at end of file
diff --git a/fileTemplates/includes/[Joomla] Manifests - Updates.xml b/fileTemplates/includes/[Joomla] Manifests - Updates.xml
new file mode 100644
index 0000000..73bb9c8
--- /dev/null
+++ b/fileTemplates/includes/[Joomla] Manifests - Updates.xml
@@ -0,0 +1,7 @@
+#if (${updateserver})
+
+
+ $updateserver
+
+
+#end
\ No newline at end of file
diff --git a/options/file.template.settings.xml b/options/file.template.settings.xml
new file mode 100644
index 0000000..9ff2411
--- /dev/null
+++ b/options/file.template.settings.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project/.phing/ProjectTask.php b/project/.phing/ProjectTask.php
index fe09623..661351f 100644
--- a/project/.phing/ProjectTask.php
+++ b/project/.phing/ProjectTask.php
@@ -1,12 +1,38 @@
version = $version;
-
- $version = explode('.', $version);
- $count = count($version);
- $devVersion = array();
+ $version = explode('.', $version);
+ $count = count($version);
+ $devVersion = [];
foreach ($version as $i => $number)
{
$number = (int) $number;
@@ -32,6 +57,7 @@ public function setVersion($version)
}
$this->devVersion = implode('.', $devVersion);
+ $this->date = date('F Y');
}
public function setRoot($root)
@@ -46,15 +72,25 @@ public function main()
return $this->$action();
}
- protected function info()
+ public function info()
+ {
+ echo implode(PHP_EOL, [
+ '==== Project Info ===',
+ 'Name ' . $this->name,
+ 'Date ' . $this->date,
+ '[RELEASE] Version ' . $this->version,
+ '[RELEASE] Package ' . $this->getPackageName(),
+ '[DEV] Version ' . $this->devVersion,
+ '[DEV] Package ' . $this->getPackageName(true),
+ 'Base Directory ' . realpath($this->root),
+ ]);
+ }
+
+ protected function getPackageName($dev = false)
{
- echo '==== Project Info ===' . PHP_EOL
- . 'Name ' . $this->name . PHP_EOL
- . '[RELEASE] Version ' . $this->release . PHP_EOL
- . '[RELEASE] Package ' . $this->getPackageName() . PHP_EOL
- . '[DEV] Version ' . $this->devVersion . PHP_EOL
- . '[DEV] Package ' . $this->getPackageName(true) . PHP_EOL
- . 'Base Directory ' . realpath($this->root) . PHP_EOL;
+ $version = ($dev) ? $this->devVersion : $this->version;
+
+ return $this->name . '_' . $version . '.zip';
}
protected function prepareRelease()
@@ -65,9 +101,8 @@ protected function prepareRelease()
echo ($files = $this->replaceVersion($this->version)) ? 'OK' : 'ERROR';
echo PHP_EOL;
- $date = date('F Y');
echo 'Replace date .......... ';
- echo ($files = $this->replaceDate($date, $files)) ? 'OK' : 'ERROR';
+ echo ($this->replaceDate($files)) ? 'OK' : 'ERROR';
echo PHP_EOL;
}
@@ -85,8 +120,7 @@ protected function resetSince()
echo 'Find Files ....... ';
$root = $this->root . DIRECTORY_SEPARATOR;
- $files = (!empty($files)) ? $files
- : $this->getFiles($root, array('.idea/', '.packages/', '.phing/', 'build/', '.gitignore', 'LICENSE', '*.md'));
+ $files = (!empty($files)) ? $files : $this->getFiles($root, $this->filesExcludes);
echo ($files) ? 'OK' : 'ERROR' . PHP_EOL;
echo PHP_EOL;
@@ -95,7 +129,7 @@ protected function resetSince()
{
foreach ($files as $path)
{
- $file = new PhingFile($root, $path);
+ $file = new File($root, $path);
$filename = $file->getAbsolutePath();
$original = file_get_contents($filename);
$replace = preg_replace('/@since(\s*)(.?)*/', '@since${1}' . '__DEPLOY_VERSION__', $original);
@@ -106,9 +140,9 @@ protected function resetSince()
}
echo 'OK';
}
- catch (Exception $exception)
+ catch (Exception $e)
{
- echo 'ERROR';
+ echo 'ERROR: ' . $e->getMessage();
}
echo PHP_EOL;
}
@@ -121,6 +155,11 @@ protected function prepareDev()
echo ($files = $this->replaceVersion($this->devVersion)) ? 'OK' : 'ERROR';
echo PHP_EOL;
+ $date = date('F Y');
+ echo 'Replace date .......... ';
+ echo ($files = $this->replaceDate($date, $files)) ? 'OK' : 'ERROR';
+ echo PHP_EOL;
+
echo 'Check PhpStorm copyrights ....... ';
echo ($files = $this->checkPhpStormCopyrights('__DEPLOY_VERSION__', date('F Y'))) ? 'OK' : 'ERROR';
echo PHP_EOL;
@@ -130,50 +169,50 @@ protected function packageDev()
{
echo '==== Package ' . $this->name . ' ' . $this->devVersion . ' Dev ===' . PHP_EOL;
echo 'Create package ....... ';
- echo ($files = $this->createPackage($this->getPackageName(true))) ? 'OK' : 'ERROR';
+ echo ($this->createPackage($this->getPackageName(true))) ? 'OK' : 'ERROR';
echo PHP_EOL;
}
- protected function replaceVersion($version = '', $files = array())
+ protected function replaceVersion($version = '', $files = [])
{
$root = $this->root . DIRECTORY_SEPARATOR;
- $files = (!empty($files)) ? $files
- : $this->getFiles($root, array('.idea/', '.packages/', '.phing/', 'build/node_modules', '.gitignore', 'LICENSE', '*.md'));
-
- if (empty($files)) return false;
+ $files = (!empty($files)) ? $files : $this->getFiles($root, $this->filesExcludes);
+ if (empty($files))
+ {
+ return false;
+ }
$dev = ($version == $this->devVersion);
$docVersion = ($dev) ? '__DEPLOY_VERSION__' : $version;
$deployVersion = ($dev) ? '__DEPLOY_VERSION__' : $version;
foreach ($files as $path)
{
- $file = new PhingFile($root, $path);
+ $file = new File($root, $path);
$filename = $file->getAbsolutePath();
$original = file_get_contents($filename);
$replace = preg_replace('/@version(\s*)(.?)*/', '@version${1}' . $docVersion, $original);
$replace = preg_replace('/\(.?)*<\/version\>/', '' . $version . '', $replace);
$replace = preg_replace('/\*Version:(\s*)(.?)*/', '* Version:${1}' . $version, $replace);
$replace = str_replace('__DEPLOY_VERSION__', $deployVersion, $replace);
+ if (strpos($path, '.json') !== false)
+ {
+ $json = json_decode($replace);
+ $replace = str_replace('"version": "' . $json->version . '",',
+ '"version": "' . $version . '",', $replace);
+ }
if ($original != $replace)
{
file_put_contents($filename, $replace);
}
}
- $package = $root . '/build/package.json';
- if ($context = @file_get_contents($package))
- {
- $context = preg_replace('/"version": "(.?)*"/', '"version": "' . $version . '"', $context);
- file_put_contents($package, $context);
- }
-
return $files;
}
protected function checkPhpStormCopyrights($version = '', $date = '')
{
$root = $this->root . DIRECTORY_SEPARATOR . '.idea/copyright';
- if (!$files = $this->getFiles($root, array('profiles_settings.xml'))) return false;
+ if (!$files = $this->getFiles($root, ['profiles_settings.xml'])) return false;
foreach ($files as $path)
{
@@ -191,23 +230,23 @@ protected function checkPhpStormCopyrights($version = '', $date = '')
return true;
}
- protected function replaceDate($date = '', $files = array())
+ protected function replaceDate($files = [])
{
$root = $this->root . DIRECTORY_SEPARATOR;
$files = (!empty($files)) ? $files
- : $this->getFiles($root, array('.idea/', '.packages/', '.phing/', 'build/', '.gitignore', 'LICENSE', '*.md'));
+ : $this->getFiles($root, ['.idea/', '.packages/', '.phing/', 'node_modules/', '.gitignore', 'LICENSE', '*.md']);
if (empty($files)) return false;
foreach ($files as $path)
{
- $file = new PhingFile($root, $path);
+ $file = new File($root, $path);
$filename = $file->getAbsolutePath();
$original = file_get_contents($filename);
- $replace = preg_replace('/@date(\s*)(.?)*/', '@date${1}' . $date, $original);
- $replace = preg_replace('/\(.?)*<\/date\>/', '' . $date . '', $replace);
- $replace = preg_replace('/\(.?)*<\/creationDate\>/', '' . $date . '', $replace);
- $replace = str_replace('__DEPLOY_DATE__', $date, $replace);
+ $replace = preg_replace('/@date(\s*)(.?)*/', '@date${1}' . $this->date, $original);
+ $replace = preg_replace('/\(.?)*<\/date\>/', '' . $this->date . '', $replace);
+ $replace = preg_replace('/\(.?)*<\/creationDate\>/', '' . $this->date . '', $replace);
+ $replace = str_replace('__DEPLOY_DATE__', $this->date, $replace);
if ($original != $replace)
{
file_put_contents($filename, $replace);
@@ -217,7 +256,7 @@ protected function replaceDate($date = '', $files = array())
return $files;
}
- protected function createPackage($package = '', $files = array())
+ protected function createPackage($package = '', $files = [])
{
$root = $this->root . DIRECTORY_SEPARATOR;
$directory = $root . '.packages/';
@@ -226,10 +265,12 @@ protected function createPackage($package = '', $files = array())
return (unlink($directory . $package)) ? $this->createPackage($package, $files) : false;
}
$package = $directory . $package;
- $files = (!empty($files)) ? $files
- : $this->getFiles($root, array('.idea/', '.packages/', '.phing/', 'build/', '.gitignore', 'LICENSE', '*.md'));
- if (empty($files)) return false;
+ $files = (!empty($files)) ? $files : $this->getFiles($root, $this->packageExcludes);
+ if (empty($files))
+ {
+ return false;
+ }
$zip = new ZipArchive();
if ($zip->open($package, ZIPARCHIVE::CREATE) !== true)
@@ -239,7 +280,7 @@ protected function createPackage($package = '', $files = array())
foreach ($files as $path)
{
- $file = new PhingFile($root, $path);
+ $file = new File($root, $path);
$clear = $file->getPathWithoutBase($root);
$clear = str_replace('\\', '/', $clear);
@@ -269,11 +310,4 @@ protected function getFiles($directory = '../', $exclude = '')
return $scanner->getIncludedFiles();
}
-
- protected function getPackageName($dev = false)
- {
- $version = ($dev) ? $this->devVersion : $this->version;
-
- return $this->name . '_' . $version . '.zip';
- }
}
\ No newline at end of file
diff --git a/templates/ES6.xml b/templates/ES6.xml
new file mode 100644
index 0000000..4e8852a
--- /dev/null
+++ b/templates/ES6.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/Joomla.xml b/templates/Joomla.xml
index 209d72f..35bf92a 100644
--- a/templates/Joomla.xml
+++ b/templates/Joomla.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/templates/PHP.xml b/templates/PHP.xml
index 833dc6f..46c964b 100644
--- a/templates/PHP.xml
+++ b/templates/PHP.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/watchers/webpack.xml b/watchers/webpack.xml
new file mode 100644
index 0000000..5d3d260
--- /dev/null
+++ b/watchers/webpack.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file