2020-03-21 11:16:28 +00:00
|
|
|
<?php
|
2022-09-08 08:54:04 +00:00
|
|
|
|
2020-03-21 11:16:28 +00:00
|
|
|
/**
|
|
|
|
* Patch testing component for the Joomla! CMS
|
|
|
|
*
|
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later
|
|
|
|
*/
|
|
|
|
|
2020-04-11 18:59:03 +00:00
|
|
|
use Joomla\CMS\Factory;
|
|
|
|
use Joomla\CMS\HTML\HTMLHelper;
|
2020-03-21 11:16:28 +00:00
|
|
|
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
|
|
|
|
use Joomla\CMS\Installer\InstallerScript;
|
2020-04-04 20:34:16 +00:00
|
|
|
use Joomla\CMS\Language\Text;
|
2020-03-21 11:16:28 +00:00
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
// phpcs:disable PSR1.Files.SideEffects
|
|
|
|
\defined('_JEXEC') or die;
|
|
|
|
// phpcs:enable PSR1.Files.SideEffects
|
|
|
|
|
2020-03-21 11:16:28 +00:00
|
|
|
/**
|
|
|
|
* Installation class to perform additional changes during install/uninstall/update
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
|
|
|
class Com_PatchtesterInstallerScript extends InstallerScript
|
|
|
|
{
|
2022-09-08 08:54:04 +00:00
|
|
|
/**
|
|
|
|
* Extension script constructor.
|
|
|
|
*
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->minimumJoomla = '4.0';
|
|
|
|
$this->minimumPhp = JOOMLA_MINIMUM_PHP;
|
2023-08-21 19:16:22 +00:00
|
|
|
$this->deleteFolders = [
|
|
|
|
'/administrator/components/com_patchtester/PatchTester',
|
2022-09-08 08:54:04 +00:00
|
|
|
'/components/com_patchtester',
|
2023-08-21 19:16:22 +00:00
|
|
|
];
|
2022-09-08 08:54:04 +00:00
|
|
|
Factory::getApplication()
|
|
|
|
->getLanguage()
|
|
|
|
->load('com_patchtester.sys', JPATH_ADMINISTRATOR, null, true);
|
|
|
|
}
|
2020-04-04 20:34:16 +00:00
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
/**
|
|
|
|
* Show the message on install.
|
|
|
|
*
|
|
|
|
* @param ComponentAdapter $parent The class calling this method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 4.0.0
|
|
|
|
*/
|
|
|
|
public function install(ComponentAdapter $parent): void
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<h1>
|
|
|
|
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
|
|
|
|
<?php echo Text::_('COM_PATCHTESTER'); ?>
|
|
|
|
</h1>
|
|
|
|
<p><?php echo Text::_('COM_PATCHTESTER_INSTALL_INSTRUCTIONS'); ?></p>
|
|
|
|
<?php
|
|
|
|
}
|
2020-04-11 18:59:03 +00:00
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
/**
|
|
|
|
* Show the message on install.
|
|
|
|
*
|
|
|
|
* @param ComponentAdapter $parent The class calling this method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 4.0.0
|
|
|
|
*/
|
|
|
|
public function update(ComponentAdapter $parent): void
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<h1>
|
|
|
|
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
|
|
|
|
<?php echo Text::_('COM_PATCHTESTER'); ?>
|
|
|
|
</h1>
|
|
|
|
<p><?php echo Text::_('COM_PATCHTESTER_UPDATE_INSTRUCTIONS'); ?></p>
|
|
|
|
<?php
|
|
|
|
}
|
2020-04-11 18:59:03 +00:00
|
|
|
|
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
/**
|
|
|
|
* Show the message on install.
|
|
|
|
*
|
|
|
|
* @param ComponentAdapter $parent The class calling this method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 4.0.0
|
|
|
|
*/
|
|
|
|
public function uninstall(ComponentAdapter $parent): void
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<h1>
|
|
|
|
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
|
|
|
|
</h1>
|
|
|
|
<p><?php echo Text::_('COM_PATCHTESTER_UNINSTALL_THANK_YOU'); ?></p>
|
|
|
|
<?php
|
|
|
|
}
|
2020-03-21 11:16:28 +00:00
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
/**
|
|
|
|
* Function to perform changes during postflight
|
|
|
|
*
|
|
|
|
* @param string $type The action being performed
|
|
|
|
* @param ComponentAdapter $parent The class calling this method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
|
|
|
public function postflight(string $type, ComponentAdapter $parent): void
|
|
|
|
{
|
|
|
|
$this->removeFiles();
|
|
|
|
}
|
2020-04-04 21:06:19 +00:00
|
|
|
}
|