mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
31 lines
640 B
PHP
31 lines
640 B
PHP
<?php
|
|
|
|
namespace Grocy\Services;
|
|
|
|
class ApplicationService extends BaseService
|
|
{
|
|
private $InstalledVersion;
|
|
public function GetInstalledVersion()
|
|
{
|
|
if ($this->InstalledVersion == null)
|
|
{
|
|
$this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json'));
|
|
}
|
|
|
|
return $this->InstalledVersion;
|
|
}
|
|
|
|
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
|
|
);
|
|
}
|
|
}
|