‪TYPO3CMS  ‪main
CoreRelease.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 {
22  protected const ‪RELEASE_TYPE_REGULAR = 'regular';
23  protected const ‪RELEASE_TYPE_SECURITY = 'security';
24 
25  public function ‪__construct(
26  protected readonly string $version,
27  protected readonly \DateTimeInterface $date,
28  protected readonly string $type,
29  protected readonly string $checksum,
30  protected readonly bool $isElts = false
31  ) {}
32 
33  public static function ‪fromApiResponse(array $response): self
34  {
35  return new self($response['version'], new \DateTimeImmutable($response['date']), $response['type'], $response['tar_package']['sha1sum'], $response['elts'] ?? false);
36  }
37 
38  public function ‪getVersion(): string
39  {
40  return $this->version;
41  }
42 
43  public function ‪getDate(): \DateTimeInterface
44  {
45  return $this->date;
46  }
47 
48  public function ‪isSecurityUpdate(): bool
49  {
50  return $this->type === ‪self::RELEASE_TYPE_SECURITY;
51  }
52 
53  public function ‪getChecksum(): string
54  {
55  return $this->checksum;
56  }
57 
58  public function ‪isElts(): bool
59  {
60  return $this->isElts;
61  }
62 }
‪TYPO3\CMS\Install\CoreVersion
Definition: CoreRelease.php:18
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\__construct
‪__construct(protected readonly string $version, protected readonly \DateTimeInterface $date, protected readonly string $type, protected readonly string $checksum, protected readonly bool $isElts=false)
Definition: CoreRelease.php:25
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\isSecurityUpdate
‪isSecurityUpdate()
Definition: CoreRelease.php:48
‪TYPO3\CMS\Install\CoreVersion\CoreRelease
Definition: CoreRelease.php:21
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\RELEASE_TYPE_SECURITY
‪const RELEASE_TYPE_SECURITY
Definition: CoreRelease.php:23
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\getDate
‪getDate()
Definition: CoreRelease.php:43
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\fromApiResponse
‪static fromApiResponse(array $response)
Definition: CoreRelease.php:33
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\RELEASE_TYPE_REGULAR
‪const RELEASE_TYPE_REGULAR
Definition: CoreRelease.php:22
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\getChecksum
‪getChecksum()
Definition: CoreRelease.php:53
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\isElts
‪isElts()
Definition: CoreRelease.php:58
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\getVersion
‪getVersion()
Definition: CoreRelease.php:38