mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-25 00:51:25 -05:00
31 lines
595 B
PHP
31 lines
595 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Utilities;
|
||
|
|
||
|
class Version
|
||
|
{
|
||
|
/**
|
||
|
* The version file
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
private static $version_file_path = '/storage/app/__version.txt';
|
||
|
|
||
|
/**
|
||
|
* Returns the current version (or 0 if none is set)
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public static function get()
|
||
|
{
|
||
|
$full_version_file_path = base_path() . self::$version_file_path;
|
||
|
$version = '0';
|
||
|
|
||
|
if (file_exists($full_version_file_path)) {
|
||
|
$version = trim(file_get_contents($full_version_file_path));
|
||
|
}
|
||
|
|
||
|
return $version;
|
||
|
}
|
||
|
}
|