Files
grocy/services/ApplicationService.php

31 lines
640 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
{
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
}
public function GetSystemInfo()
{
$pdo = new \PDO('sqlite::memory:');
$sqliteVersion = $pdo->query('SELECT sqlite_version()')->fetch()[0];
$pdo = null;
return array(
'grocy_version' => $this->GetInstalledVersion(),
'php_version' => phpversion(),
'sqlite_version' => $sqliteVersion
);
}
2018-04-10 20:30:11 +02:00
}