Skip to content

Commit

Permalink
Merge branch 'staging' into 400minimumupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Sep 3, 2019
2 parents 9056704 + 00cd975 commit 6e7f376
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 16 deletions.
15 changes: 15 additions & 0 deletions administrator/components/com_joomlaupdate/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@
<option value="custom">COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM</option>
</field>

<field
name="minimum_stability"
type="list"
label="COM_JOOMLAUPDATE_MINIMUM_STABILITY_LABEL"
description="COM_JOOMLAUPDATE_MINIMUM_STABILITY_DESC"
default="4"
showon="updatesource:testing[OR]updatesource:custom"
>
<option value="0">COM_JOOMLAUPDATE_MINIMUM_STABILITY_DEV</option>
<option value="1">COM_JOOMLAUPDATE_MINIMUM_STABILITY_ALPHA</option>
<option value="2">COM_JOOMLAUPDATE_MINIMUM_STABILITY_BETA</option>
<option value="3">COM_JOOMLAUPDATE_MINIMUM_STABILITY_RC</option>
<option value="4">COM_JOOMLAUPDATE_MINIMUM_STABILITY_STABLE</option>
</field>

<field
name="customurl"
type="text"
Expand Down
27 changes: 20 additions & 7 deletions administrator/components/com_joomlaupdate/models/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,17 @@ public function refreshUpdates($force = false)
}
else
{
$update_params = JComponentHelper::getParams('com_installer');
$cache_timeout = $update_params->get('cachetimeout', 6, 'int');
$cache_timeout = 3600 * $cache_timeout;
$cache_timeout = 3600 * JComponentHelper::getParams('com_installer')->get('cachetimeout', 6, 'int');
}

$updater = JUpdater::getInstance();
$updater = JUpdater::getInstance();
$minimumStability = JUpdater::STABILITY_STABLE;
$comJoomlaupdateParams = JComponentHelper::getParams('com_joomlaupdate');

if (in_array($comJoomlaupdateParams->get('updatesource', 'nochange'), array('testing', 'custom')))
{
$minimumStability = $comJoomlaupdateParams->get('minimum_stability', JUpdater::STABILITY_STABLE);
}

$reflection = new ReflectionObject($updater);
$reflectionMethod = $reflection->getMethod('findUpdates');
Expand All @@ -128,11 +133,11 @@ public function refreshUpdates($force = false)
if (count($methodParameters) >= 4)
{
// Reinstall support is available in JUpdater
$updater->findUpdates(700, $cache_timeout, JUpdater::STABILITY_STABLE, true);
$updater->findUpdates(700, $cache_timeout, $minimumStability, true);
}
else
{
$updater->findUpdates(700, $cache_timeout, JUpdater::STABILITY_STABLE);
$updater->findUpdates(700, $cache_timeout, $minimumStability);
}
}

Expand Down Expand Up @@ -187,10 +192,18 @@ public function getUpdateInformation()
$ret['hasUpdate'] = true;
}

$minimumStability = JUpdater::STABILITY_STABLE;
$comJoomlaupdateParams = JComponentHelper::getParams('com_joomlaupdate');

if (in_array($comJoomlaupdateParams->get('updatesource', 'nochange'), array('testing', 'custom')))
{
$minimumStability = $comJoomlaupdateParams->get('minimum_stability', JUpdater::STABILITY_STABLE);
}

// Fetch the full update details from the update details URL.
jimport('joomla.updater.update');
$update = new JUpdate;
$update->loadFromXML($updateObject->detailsurl);
$update->loadFromXML($updateObject->detailsurl, $minimumStability);

$ret['object'] = $update;

Expand Down
25 changes: 16 additions & 9 deletions administrator/language/en-GB/en-GB.com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
; Note : All ini files need to be saved as UTF-8

COM_JOOMLAUPDATE_CHECKED_UPDATES="Checked for updates."
COM_JOOMLAUPDATE_CONFIGURATION="Joomla Update: Options"
COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_DESC="This is a custom XML update source URL, used only when the &quot;Update Source&quot; option is set to &quot;Custom URL&quot;."
COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_LABEL="Custom URL"
COM_JOOMLAUPDATE_CONFIG_SOURCES_DESC="Configure where Joomla gets its update information from."
Expand All @@ -15,10 +16,16 @@ COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DESC="The update channel Joomla will use to
COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_LABEL="Update Channel"
COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT="Joomla Next"
COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING="Testing"
COM_JOOMLAUPDATE_CONFIGURATION="Joomla Update: Options"
COM_JOOMLAUPDATE_FAILED_TO_CHECK_UPDATES="Failed to check for updates."
COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_ALPHA="Alpha"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_BETA="Beta"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_DESC="The minimum stability of the extension updates you would like to see. Development is the least stable, Stable is production quality. If an extension doesn't specify a level it is assumed to be Stable."
COM_JOOMLAUPDATE_MINIMUM_STABILITY_DEV="Development"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_LABEL="Minimum Stability"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_RC="Release Candidate"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_STABLE="Stable"
COM_JOOMLAUPDATE_OVERVIEW="Joomla Update"
COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP="Cleaning up after installation."
COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE="Update to version %s is complete."
; The following two strings are deprecated and will be removed with 4.0
Expand All @@ -33,37 +40,37 @@ COM_JOOMLAUPDATE_UPDATE_LOG_URL="Downloading update file from %s."
COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING="Joomla Version Update Status"
COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been updated. Your Joomla version is now %s."
COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS="Downloading update file. Please wait ..."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. There are two possibilities why this happens:<br>- Your host doesn't support <a href="_QQ_"https://downloads.joomla.org/technical-requirements"_QQ_">the minimum requirements for Joomla %1$s</a> and there is no alternative download for your configuration available.<br>- There is a problem with the Joomla Update Server.<br><br>Please try to download the update package from <a href="_QQ_"https://downloads.joomla.org/latest"_QQ_">the official Joomla download page</a> and use the Upload and Update tab."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="Live Update is not available"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="There is a new version of the Joomla Update Component that needs to be installed first. <a class=\"alert-link\" href="_QQ_"index.php?option=com_installer&view=update"_QQ_">Click here to update the component</a>."
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP Root"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_HOSTNAME="FTP Host"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PASSWORD="FTP Password"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PORT="FTP Port"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_USERNAME="FTP Username"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL="Additional Information"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST="You must update to the latest version of the Joomla Update Component before you can install the Joomla Core Update!"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLAGAIN="Reinstall Joomla core files"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Install the Update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST="You must update to the latest version of the Joomla Update Component before you can update Joomla!"
COM_JOOMLAUPDATE_VIEW_DEFAULT_LATEST="Latest Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD="Installation method"
COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD_DIRECT="Write files directly"
COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD_FTP="Write files using FTP"
COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD_HYBRID="Hybrid (use FTP only if needed)"
COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD="Installation method"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES="No updates available."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE="You already have the latest Joomla version, %s."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to download that update. There are three possibilities why this happens:<br>- Your host doesn't support <a href="_QQ_"https://downloads.joomla.org/technical-requirements"_QQ_">the minimum requirements for Joomla %1$s</a> and there is no alternative download for your configuration available.<br>- The update to Joomla %1$s is not available for your stability level.<br>- There is a problem with the Joomla Update Server.<br><br>Please try to download the update package from <a href="_QQ_"https://downloads.joomla.org/latest"_QQ_">the official Joomla download page</a> and use the Upload and Update tab."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="Live Update is not available"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="There is a new version of the Joomla Update Component that needs to be installed first. <a class=\"alert-link\" href="_QQ_"index.php?option=com_installer&view=update"_QQ_">Click here to update the component</a>."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_REINSTALL="Reinstall package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_TAB_ONLINE="Live Update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_TAB_UPLOAD="Upload & Update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla, ensure that the installed extensions are available for the new Joomla version. <br>You are strongly advised to make a <strong>backup</strong> of your installation before you start updating."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATEFOUND="A Joomla update was found."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM="You are on the &quot;%s&quot; update channel. This is not an official Joomla update channel."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (3.x)"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (3.x) and you will also be notified when the future major release (4.x) will be available. Before upgrading to 4.x you'll need to assess its compatibility with your environment."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the &quot;%s&quot; update channel. This channel is designed for testing new releases and fixes in Joomla.<br />It is only intended for JBS (Joomla Bug Squad&trade;) members and others within the Joomla community who are testing. Do not use this setting on a production site."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla, ensure that the installed extensions are available for the new Joomla version. <br>You are strongly advised to make a <strong>backup</strong> of your installation before you start updating."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla <em>Upgrade Package</em> in ZIP format from <a class=\"alert-link\" href=\"%s\">the official Joomla download page</a>. Then use the fields below to upload and install it."
COM_JOOMLAUPDATE_VIEW_PROGRESS="Update progress"
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted"
Expand Down

0 comments on commit 6e7f376

Please sign in to comment.