Fallback to ANONADDY_VERSION env var if empty
This commit is contained in:
parent
a605891cb2
commit
a8d1243dcc
1 changed files with 8 additions and 2 deletions
|
@ -9,8 +9,14 @@ class AppVersionController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$parts = str(Version::version())->explode('.');
|
||||
|
||||
$ver = str(Version::version());
|
||||
if (strlen($ver) == 0) {
|
||||
$ver = getenv('ANONADDY_VERSION', true);
|
||||
if ($ver == null) {
|
||||
$ver = '';
|
||||
}
|
||||
}
|
||||
$parts = $ver->explode('.');
|
||||
return response()->json([
|
||||
'version' => Version::version(),
|
||||
'major' => (int) isset($parts[0]) ? $parts[0] : null,
|
||||
|
|
Loading…
Add table
Reference in a new issue