mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-21 23:52:31 -05:00
30 lines
595 B
PHP
30 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;
|
|
}
|
|
}
|