33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 19:09:00 +00:00
Link to Patchtester after Installation
This commit is contained in:
Matt Meyrick 2020-04-04 21:34:16 +01:00
parent 0306c7e129
commit 167a01a50b
4 changed files with 62 additions and 5 deletions

View File

@ -15,6 +15,8 @@ COM_PATCHTESTER_CONFIGURATION="Joomla! Patch Tester Settings"
COM_PATCHTESTER_CONFIRM_RESET="Resetting will attempt to revert all applied patches and removes all backed up files. This may result in a corrupted environment. Are you sure you want to continue?"
COM_PATCHTESTER_CONFLICT_S="The patch could not be applied because it conflicts with a previously applied patch: %s"
COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB="Could not connect to GitHub: %s"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_ERROR_APPLIED_PATCHES="Cannot fetch data from GitHub while there are applied patches. Please revert those patches before continuing."
COM_PATCHTESTER_ERROR_CANNOT_COPY_FILE="Cannot copy source file %1$s to destination %2$s"
COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE="Cannot delete file %s"
@ -76,15 +78,27 @@ COM_PATCHTESTER_FILTER_APPLIED_PATCHES="Filter Applied Patches"
COM_PATCHTESTER_FILTER_BRANCH="Filter Target Branch"
COM_PATCHTESTER_FILTER_RTC_PATCHES="Filter RTC Patches"
COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION="Search the list by title or prefix with 'id:' to search by Pull ID."
COM_PATCHTESTER_GOTO="Go to"
COM_PATCHTESTER_GITHUB="GitHub"
COM_PATCHTESTER_HEADING_FETCH_DATA="Fetching GitHub Data"
COM_PATCHTESTER_INSTALL_TEXT="Patch Tester Install script"
COM_PATCHTESTER_JISSUE="J! Issue"
COM_PATCHTESTER_JISSUES="Issue Tracker"
COM_PATCHTESTER_LINK="Component"
COM_PATCHTESTER_NO_CREDENTIALS="You have not entered your user credentials in the Options. This will limit you to only 60 requests to the GitHub API per hour. Adding your credentials will allow 5,000 requests per hour."
COM_PATCHTESTER_NO_FILES_TO_PATCH="There are no files to patch from this pull request. This may mean that the files in the pull request are not present in your installation."
COM_PATCHTESTER_NO_ITEMS="No data has been retrieved from GitHub, please click the 'Fetch Data' button in the toolbar to retrieve the open pull requests."
COM_PATCHTESTER_NOT_APPLIED="Not Applied"
COM_PATCHTESTER_NOT_RTC="Not RTC"
COM_PATCHTESTER_OPTIONS="Options"
COM_PATCHTESTER_POSTFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester postflight discover install script"
COM_PATCHTESTER_POSTFLIGHT_INSTALL_TEXT="Patch Tester postflight install script"
COM_PATCHTESTER_POSTFLIGHT_UNINSTALL_TEXT="Patch Tester postflight uninstall script"
COM_PATCHTESTER_POSTFLIGHT_UPDATE_TEXT="Patch Tester postflight update script"
COM_PATCHTESTER_PREFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester preflight discover install script"
COM_PATCHTESTER_PREFLIGHT_INSTALL_TEXT="Patch Tester preflight install script"
COM_PATCHTESTER_PREFLIGHT_UNINSTALL_TEXT="Patch Tester preflight uninstall script"
COM_PATCHTESTER_PREFLIGHT_UPDATE_TEXT="Patch Tester preflight update script"
COM_PATCHTESTER_PULL_ID="Pull ID"
COM_PATCHTESTER_PULL_ID_ASC="Pull ID ascending"
COM_PATCHTESTER_PULL_ID_DESC="Pull ID descending"
@ -104,8 +118,12 @@ COM_PATCHTESTER_SERVER_RESPONDED_NOT_200="The patch could not be applied either
COM_PATCHTESTER_TEST_THIS_PATCH="Test This Patch"
COM_PATCHTESTER_TOOLBAR_FETCH_DATA="Fetch Data"
COM_PATCHTESTER_TOOLBAR_RESET="Reset"
COM_PATCHTESTER_UNINSTALL_TEXT="Patch Tester Uninstall script"
COM_PATCHTESTER_UNINSTALL_THANK_YOU="Thank you for using Joomla! Patch Tester for testing patches for the latest version of Joomla!"
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."
COM_PATCHTESTER_VIEW_ON_GITHUB="View on GitHub"
COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER="View on Joomla! Issue Tracker"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"
COM_PATCHTESTER_ZIP_DOES_NOT_EXIST="The patch could not be applied because it couldn't be retrieved from server."
COM_PATCHTESTER_ZIP_EXTRACT_FAILED="The patch could not be applied because it couldn't be extracted."
COM_PATCHTESTER_PATCH_BREAKS_SITE="The patch could not be applied because it would break the site. Check the pull request to see if it is up-to-date."
COM_PATCHTESTER_PATCH_BREAKS_SITE="The patch could not be applied because it would break the site. Check the pull request to see if it is up-to-date."

View File

@ -7,3 +7,17 @@ COM_PATCHTESTER="Joomla! Patch Tester"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"
COM_PATCHTESTER_GOTO="Go to"
COM_PATCHTESTER_LINK="Component"
COM_PATCHTESTER_OPTIONS="Options"
COM_PATCHTESTER_INSTALL_TEXT="Patch Tester Install script"
COM_PATCHTESTER_POSTFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester postflight discover install script"
COM_PATCHTESTER_POSTFLIGHT_INSTALL_TEXT="Patch Tester postflight install script"
COM_PATCHTESTER_POSTFLIGHT_UNINSTALL_TEXT="Patch Tester postflight uninstall script"
COM_PATCHTESTER_POSTFLIGHT_UPDATE_TEXT="Patch Tester postflight update script"
COM_PATCHTESTER_PREFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester preflight discover install script"
COM_PATCHTESTER_PREFLIGHT_INSTALL_TEXT="Patch Tester preflight install script"
COM_PATCHTESTER_PREFLIGHT_UNINSTALL_TEXT="Patch Tester preflight uninstall script"
COM_PATCHTESTER_PREFLIGHT_UPDATE_TEXT="Patch Tester preflight update script"
COM_PATCHTESTER_UNINSTALL_TEXT="Patch Tester Uninstall script"
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."

View File

@ -2,12 +2,12 @@
<extension type="component" version="4.0" method="upgrade">
<name>com_patchtester</name>
<author>Joomla! Project</author>
<creationDate>04-April-2020</creationDate>
<creationDate>03-April-2020</creationDate>
<copyright>(C) 2011 - 2012 Ian MacLennan, (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>https://www.joomla.org</authorUrl>
<version>4.0.0-rc2</version>
<version>4.0.0-rc</version>
<description>COM_PATCHTESTER_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>
<install>
@ -49,6 +49,10 @@
<filename>config.xml</filename>
<filename>patchtester.php</filename>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_patchtester.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_patchtester.sys.ini</language>
</languages>
</administration>
<updateservers>
<server type="extension" name="Patch Tester Component">https://raw.githubusercontent.com/joomla-extensions/patchtester/master/manifest.xml</server>

View File

@ -8,6 +8,8 @@
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
/**
* Installation class to perform additional changes during install/uninstall/update
@ -16,6 +18,7 @@ use Joomla\CMS\Installer\InstallerScript;
*/
class Com_PatchtesterInstallerScript extends InstallerScript
{
/**
* Extension script constructor.
*
@ -48,6 +51,24 @@ class Com_PatchtesterInstallerScript extends InstallerScript
*/
public function postflight($type, $parent)
{
$this->removeFiles();
if ( $type == 'install' ) {
$language = JFactory::getLanguage();
$language->load('com_patchtester', JPATH_ADMINISTRATOR, null, true);
$language->load('com_patchtester', JPATH_SITE, null, true);
echo '<h1><img src="../media/com_patchtester/images/icon-48-patchtester.png"> ' . Text::_('COM_PATCHTESTER') . '</h1>';
echo '<p>' . Text::_('COM_PATCHTESTER_XML_DESCRIPTION') . '</p>';
echo '<p>' . Text::_('COM_PATCHTESTER_GOTO') . ' <a href="index.php?option=com_patchtester">' . Text::_('COM_PATCHTESTER') . '</a></p>';
//echo '<p>' . Text::_('COM_PATCHTESTER_GOTO') . ' <a href="index.php?option=com_config&view=component&component=com_patchtester#authentication &path=&return=aHR0cDovL2xvY2FsaG9zdC9wYXRjaDRhMTIvYWRtaW5pc3RyYXRvci9pbmRleC5waHA%2Fb3B0aW9uPWNvbV9wYXRjaHRlc3Rlcg%3D%3D">' . Text::_('COM_PATCHTESTER_OPTIONS') . '</a></p>';
echo '<p>' . Text::_('COM_PATCHTESTER_GOTO') . ' <a href="index.php?option=com_config&view=component&component=com_patchtester#authentication">' . Text::_('COM_PATCHTESTER_OPTIONS') . '</a></p>';
}
if ( $type == 'uninstall' ) {
$language = JFactory::getLanguage();
$language->load('com_patchtester', JPATH_ADMINISTRATOR, null, true);
$language->load('com_patchtester', JPATH_SITE, null, true);
echo '<h1>' . Text::_('COM_PATCHTESTER') . '</h1>';
echo '<p>' . Text::_('COM_PATCHTESTER_UNINSTALL_THANK_YOU') . '</p>';
}
}
}
}