Files
grocy/services/ApplicationService.php

34 lines
587 B
PHP
Raw Normal View History

2018-04-10 20:30:11 +02:00
<?php
2018-04-11 19:49:35 +02:00
namespace Grocy\Services;
class ApplicationService extends BaseService
2018-04-10 20:30:11 +02:00
{
/**
* @return boolean
*/
2018-04-11 19:49:35 +02:00
public function IsDemoInstallation()
2018-04-10 20:30:11 +02:00
{
2018-07-24 19:41:35 +02:00
return file_exists(GROCY_DATAPATH . '/demo.txt');
2018-07-16 21:17:32 +02:00
}
/**
* @return boolean
*/
public function IsEmbeddedInstallation()
{
return file_exists(__DIR__ . '/../embedded.txt');
2018-04-10 20:30:11 +02:00
}
2018-04-11 19:49:35 +02:00
private $InstalledVersion;
public function GetInstalledVersion()
2018-04-10 20:30:11 +02:00
{
2018-04-11 19:49:35 +02:00
if ($this->InstalledVersion == null)
2018-04-10 20:30:11 +02:00
{
$this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json'));
2018-04-10 20:30:11 +02:00
}
2018-04-11 19:49:35 +02:00
return $this->InstalledVersion;
2018-04-10 20:30:11 +02:00
}
}