]> BookStack Code Mirror - bookstack/blob - app/App/AppVersion.php
CommentDisplayTest correct namespace
[bookstack] / app / App / AppVersion.php
1 <?php
2
3 namespace BookStack\App;
4
5 class AppVersion
6 {
7     protected static string $version = '';
8
9     /**
10      * Get the application's version number from its top-level `version` text file.
11      */
12     public static function get(): string
13     {
14         if (!empty(static::$version)) {
15             return static::$version;
16         }
17
18         $versionFile = base_path('version');
19         $version = trim(file_get_contents($versionFile));
20         static::$version = $version;
21
22         return $version;
23     }
24 }