diff --git a/depot.xml b/depot.xml index 7730c70..c8e5e2e 100644 --- a/depot.xml +++ b/depot.xml @@ -2,14 +2,16 @@ Depot KW4NZ - 2024-05-26 + 2024-08-31 (C) KW4NZ Thomas Kuschel GPL v2 +; see LICENSE.md thomas@kuschel.at https://kuschel.at - 0.9.20 + 0.9.23 COM_DEPOT_XML_DESCRIPTION KW4NZ\Component\Depot + + script.php sql/install.mysql.utf8.sql diff --git a/script.php b/script.php new file mode 100644 index 0000000..f46957d --- /dev/null +++ b/script.php @@ -0,0 +1,76 @@ + + * @copyright (C) 2024 KW4NZ, + * @license GNU General Public License version 2 or later; see LICENSE.md + * @since 0.9.21 + */ +\defined('_JEXEC') or die; +/** + * Script file of Depot component. + * + * The name of this class is dependent on the component being installed. + * The class name should have the component's name, directly followed by + * the text InstallerScript (ex:. com_depotInstallerScript). + * + * This class will be called by Joomla's installer, if specified in your component's + * manifest file, and is used for custom automation actions in its installation process. + * + * In order to use this automation script, you should reference it in your component's + * mainfest file as follows: + * script.php + */ + +use Joomla\CMS\Factory; +use Joomla\CMS\Installer\InstallerAdapter; +use Joomla\CMS\Installer\InstallerScriptInterface; +use Joomla\CMS\Language\Text; + +return new class() implements InstallerScriptInterface { + private string $minimumJoomla = '4.4.8'; // '5.1.4' + private string $minimumPhp = '8.1.29'; + + public function install(InstallerAdapter $adapter): bool + { + echo "component install
"; + return true; + } + + public function update(InstallerAdapter $adapter): bool + { + + echo "component update
"; + return true; + } + + public function uninstall(InstallerAdapter $adapter): bool + { + echo "component uninstall
"; + return true; + } + + public function preflight(string $type, InstallerAdapter $adapter): bool + { + echo "component preflight
"; + + if (version_compare(PHP_VERSION, $this->minimumPhp, '<')) { + Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_PHP'), $this->minimumPhp), 'error'); + return false; + } + + if (version_compare(JVERSION, $this->minimumJoomla, '<')) { + Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_JOOMLA'), $this->minimumJoomla), 'error'); + return false; + } + + return true; + } + + public function postflight(string $type, InstallerAdapter $adapter): bool + { + echo "component postflight
"; + return true; + } +}; \ No newline at end of file diff --git a/zip/depot.zip b/zip/depot.zip index e4e926e..aba7d27 100644 --- a/zip/depot.zip +++ b/zip/depot.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:683e2cc43097985d24f461fc19520a5dab1bf71e08f7b7197c2486d43d8a1da8 -size 88203 +oid sha256:98e54fa057436193f3ee4362796c66c897bc829111b8b58d6cab03f5f80ea348 +size 89258