Implement custom entities / objects (closes #242)

This commit is contained in:
Bernd Bestel
2019-09-18 16:18:15 +02:00
parent 918f84f568
commit 096fb7a116
20 changed files with 666 additions and 18 deletions

View File

@@ -9,7 +9,20 @@ class ApplicationService extends BaseService
{
if ($this->InstalledVersion == null)
{
$this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json'));
if (GROCY_MODE === 'prerelease')
{
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
$commitDate = trim(exec('git log --date=iso --pretty="%cd" -n1 HEAD'));
$this->InstalledVersion = array(
'Version' => "pre-release-$commitHash",
'ReleaseDate' => substr($commitDate, 0, 19)
);
}
else
{
$this->InstalledVersion = json_decode(file_get_contents(__DIR__ . '/../version.json'));
}
}
return $this->InstalledVersion;