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