2 namespace TYPO3\CMS\Install\Service;
71 $this->downloadBaseUri =
'https://get.typo3.org/';
85 foreach ($versionArray as $versionNumber => $versionDetails) {
86 if (is_array($versionDetails) && (int)$this->
getMajorVersion($versionNumber) < $installedMajorVersion) {
87 unset($versionArray[$versionNumber]);
91 $this->registry->set(
'TYPO3.CMS.Install',
'coreVersionMatrix', $versionArray);
103 return substr($version, -4) !==
'-dev';
120 if (empty($versionMatrix[$majorVersion][
'releases'][$version][
'checksums'][
'tar'][
'sha1'])) {
121 throw new Exception\CoreVersionServiceException(
122 'Release sha1 of version ' . $version .
' not found in version matrix.'
123 .
' This is probably a bug on get.typo3.org.',
128 return $versionMatrix[$majorVersion][
'releases'][$version][
'checksums'][
'tar'][
'sha1'];
150 return (
bool)$versionMatrix[$majorVersion][
'active'];
162 return $youngestVersion !== $version;
175 if ($youngestVersion !== $version) {
191 if ($youngestVersion !== $version) {
232 $youngestRelease = $version;
235 $patchLevelVersions = $versionMatrix[$majorVersion][
'releases'];
236 foreach ($patchLevelVersions as $aVersionNumber => $aVersionDetails) {
237 if (!array_key_exists(
'type', $aVersionDetails)) {
238 throw new Exception\CoreVersionServiceException(
239 'Release type of version ' . $aVersionNumber .
' not found in version matrix.'
240 .
' This is probably a bug on get.typo3.org.',
244 $type = $aVersionDetails[
'type'];
247 $aVersionNumberReleaseTimestamp > $versionReleaseTimestamp
248 && in_array($type, $types)
250 $youngestRelease = $aVersionNumber;
251 $versionReleaseTimestamp = $aVersionNumberReleaseTimestamp;
254 return $youngestRelease;
275 $explodedVersion = explode(
'.', $version);
276 return $explodedVersion[0];
287 $versionMatrix = $this->registry->get(
'TYPO3.CMS.Install',
'coreVersionMatrix');
288 if (empty($versionMatrix) || !is_array($versionMatrix)) {
289 throw new Exception\CoreVersionServiceException(
290 'No version matrix found in registry, call updateVersionMatrix() first.',
294 return $versionMatrix;
305 $url = $this->downloadBaseUri .
'json';
308 throw new Exception\RemoteFetchException(
309 'Fetching ' .
$url .
' failed. Maybe this instance can not connect to the remote system properly.',
313 return json_decode($versionJson,
true);
328 if (!array_key_exists(
'date', $versionMatrix[$majorVersion][
'releases'][$version])) {
329 throw new Exception\CoreVersionServiceException(
330 'Release date of version ' . $version .
' not found in version matrix. This is probably a bug on get.typo3.org',
334 $dateString = $versionMatrix[$majorVersion][
'releases'][$version][
'date'];
335 $date = new \DateTime($dateString);
336 return $date->getTimestamp();
349 if (!array_key_exists($majorVersion, $versionMatrix)) {
350 throw new Exception\CoreVersionServiceException(
351 'Major release ' . $majorVersion .
' not found in version matrix.',
355 if (!array_key_exists($version, $versionMatrix[$majorVersion][
'releases'])) {
356 throw new Exception\CoreVersionServiceException(
357 'Patch level release ' . $version .
' not found in version matrix.',