‪TYPO3CMS  10.4
Typo3Version.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 ‪VERSION = '10.4.38-dev';
23  protected const ‪BRANCH = '10.4';
24 
28  public function ‪__construct()
29  {
30  if (!defined('TYPO3_version')) {
31  define('TYPO3_version', $this->‪getVersion());
32  }
33  if (!defined('TYPO3_branch')) {
34  define('TYPO3_branch', $this->‪getBranch());
35  }
36  }
37 
38  public function ‪getVersion(): string
39  {
40  return static::VERSION;
41  }
42 
43  public function ‪getBranch(): string
44  {
45  return static::BRANCH;
46  }
47 
53  public function ‪getMajorVersion(): int
54  {
55  [$explodedVersion] = explode('.', static::VERSION);
56  return (int)$explodedVersion;
57  }
58 
59  public function ‪__toString(): string
60  {
61  return $this->‪getVersion();
62  }
63 }
‪TYPO3\CMS\Core\Information\Typo3Version\__construct
‪__construct()
Definition: Typo3Version.php:28
‪TYPO3\CMS\Core\Information\Typo3Version\__toString
‪__toString()
Definition: Typo3Version.php:59
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Core\Information
Definition: Typo3Information.php:18
‪TYPO3\CMS\Core\Information\Typo3Version\BRANCH
‪const BRANCH
Definition: Typo3Version.php:23
‪TYPO3\CMS\Core\Information\Typo3Version\getVersion
‪getVersion()
Definition: Typo3Version.php:38
‪TYPO3\CMS\Core\Information\Typo3Version\VERSION
‪const VERSION
Definition: Typo3Version.php:22
‪TYPO3\CMS\Core\Information\Typo3Version\getBranch
‪getBranch()
Definition: Typo3Version.php:43
‪TYPO3\CMS\Core\Information\Typo3Version\getMajorVersion
‪int getMajorVersion()
Definition: Typo3Version.php:53