‪TYPO3CMS  10.4
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  protected ‪$version;
26  protected ‪$date;
27  protected ‪$type;
28  protected ‪$checksum;
29  protected ‪$isElts;
30 
31  public function ‪__construct(string ‪$version, \DateTimeInterface ‪$date, string ‪$type, string ‪$checksum, bool ‪$isElts = false)
32  {
33  $this->version = ‪$version;
34  $this->date = ‪$date;
35  $this->type = ‪$type;
36  $this->checksum = ‪$checksum;
37  $this->‪isElts = ‪$isElts;
38  }
39 
40  public static function ‪fromApiResponse(array $response): self
41  {
42  return new self($response['version'], new \DateTimeImmutable($response['date']), $response['type'], $response['tar_package']['sha1sum'], $response['elts'] ?? false);
43  }
44 
45  public function ‪getVersion(): string
46  {
47  return ‪$this->version;
48  }
49 
50  public function ‪getDate(): \DateTimeInterface
51  {
52  return ‪$this->date;
53  }
54 
55  public function ‪isSecurityUpdate(): bool
56  {
57  return $this->type === ‪self::RELEASE_TYPE_SECURITY;
58  }
59 
60  public function ‪getChecksum(): string
61  {
62  return ‪$this->checksum;
63  }
64 
65  public function ‪isElts(): bool
66  {
67  return ‪$this->isElts;
68  }
69 }
‪TYPO3\CMS\Install\CoreVersion
Definition: CoreRelease.php:18
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\$isElts
‪$isElts
Definition: CoreRelease.php:29
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\$version
‪$version
Definition: CoreRelease.php:25
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\isSecurityUpdate
‪isSecurityUpdate()
Definition: CoreRelease.php:55
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\$checksum
‪$checksum
Definition: CoreRelease.php:28
‪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:50
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\fromApiResponse
‪static fromApiResponse(array $response)
Definition: CoreRelease.php:40
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\RELEASE_TYPE_REGULAR
‪const RELEASE_TYPE_REGULAR
Definition: CoreRelease.php:22
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\$date
‪$date
Definition: CoreRelease.php:26
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\getChecksum
‪getChecksum()
Definition: CoreRelease.php:60
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\__construct
‪__construct(string $version, \DateTimeInterface $date, string $type, string $checksum, bool $isElts=false)
Definition: CoreRelease.php:31
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\isElts
‪isElts()
Definition: CoreRelease.php:65
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\getVersion
‪getVersion()
Definition: CoreRelease.php:45
‪TYPO3\CMS\Install\CoreVersion\CoreRelease\$type
‪$type
Definition: CoreRelease.php:27