Files
grocy/services/ApplicationService.php

29 lines
501 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
{
return file_exists(__DIR__ . '/../data/demo.txt');
}
2018-04-11 19:49:35 +02:00
private $InstalledVersion;
2018-04-10 20:30:11 +02:00
/**
* @return string
*/
2018-04-11 19:49:35 +02:00
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
{
2018-04-11 19:49:35 +02:00
$this->InstalledVersion = preg_replace("/\r|\n/", '', file_get_contents(__DIR__ . '/../version.txt'));
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
}
}