Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Test Service for latest secure TYPO3 core #76

Closed
wants to merge 1 commit into from
Closed

Test Service for latest secure TYPO3 core #76

wants to merge 1 commit into from

Conversation

jvanderkroon
Copy link

@@ -75,10 +77,40 @@ public static function updateLatestTypo3VersionRegistry()
if (is_array($details) && !empty($details['stable'])) {
$stable[$major] = $details['stable'];
}
if (is_array($details) && is_array($details['releases'])) {
$found = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not necessary. Just set $security[$major] to the latest before the loop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -75,10 +77,40 @@ public static function updateLatestTypo3VersionRegistry()
if (is_array($details) && !empty($details['stable'])) {
$stable[$major] = $details['stable'];
}
if (is_array($details) && is_array($details['releases'])) {
$found = false;
$latestCheckedVersion = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above. Not necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break;
}
// if versionDetails->type === 'security' then this is the security update; stop searching
if (self::extractBugfixNumberFromVersion($version) === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you don't use \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionStringToArray?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$latestCheckedVersion = $version;
// if major version > latest_lts check if bugfix part of version number == '0';
// in that case this is the security update and stop searching
if (version_compare($major, $latestLts, '>')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the fist version in releases always the one to choose for $major > $lts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention of checking $major > $latestLts at all?

}
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Registry')->set('tx_caretaker', 'TYPO3versions', $max);
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Registry')->set('tx_caretaker', 'TYPO3versionsStable', $stable);

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Registry')->set('tx_caretaker', 'TYPO3versionsSecurity', $security);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split these three lines. First get the registry object, then use it to store all three information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @param string $version
* @return integer
*/
protected static function extractBugfixNumberFromVersion($version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this is not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etobi
Copy link
Member

etobi commented Jul 14, 2017

@jvanderkroon could you please fix the code style issues and check @IchHabRecht 's comments?
I'll gladly review your updated PR.

etobi added a commit that referenced this pull request Jul 15, 2017
@etobi
Copy link
Member

etobi commented Jul 15, 2017

patch continued in #88

@etobi etobi closed this Jul 15, 2017
@etobi
Copy link
Member

etobi commented Jul 15, 2017

solves #63

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants