mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 09:01:14 +00:00
Prepare for embedded mode
This commit is contained in:
@@ -9,7 +9,15 @@ class ApplicationService extends BaseService
|
||||
*/
|
||||
public function IsDemoInstallation()
|
||||
{
|
||||
return file_exists(__DIR__ . '/../data/demo.txt');
|
||||
return file_exists(DATAPATH . '/demo.txt');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function IsEmbeddedInstallation()
|
||||
{
|
||||
return file_exists(__DIR__ . '/../embedded.txt');
|
||||
}
|
||||
|
||||
private $InstalledVersion;
|
||||
|
@@ -14,7 +14,7 @@ class DatabaseService
|
||||
{
|
||||
if ($this->DbConnectionRaw == null)
|
||||
{
|
||||
$pdo = new \PDO('sqlite:' . __DIR__ . '/../data/grocy.db');
|
||||
$pdo = new \PDO('sqlite:' . DATAPATH . '/grocy.db');
|
||||
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
||||
$this->DbConnectionRaw = $pdo;
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ class DemoDataGeneratorService extends BaseService
|
||||
|
||||
public function RecreateDemo()
|
||||
{
|
||||
unlink(__DIR__ . '/../data/grocy.db');
|
||||
unlink(DATAPATH . '/grocy.db');
|
||||
$this->PopulateDemoData();
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class LocalizationService
|
||||
|
||||
private function LogMissingLocalization(string $culture, string $text)
|
||||
{
|
||||
$file = __DIR__ . "/../data/missing_translations_$culture.json";
|
||||
$file = DATAPATH . "/missing_translations_$culture.json";
|
||||
|
||||
$missingTranslations = array();
|
||||
if (file_exists($file))
|
||||
|
@@ -222,7 +222,7 @@ class StockService extends BaseService
|
||||
throw new \Exception('No barcode lookup plugin defined');
|
||||
}
|
||||
|
||||
$path = __DIR__ . "/../data/plugins/$pluginName.php";
|
||||
$path = DATAPATH . "/plugins/$pluginName.php";
|
||||
if (file_exists($path))
|
||||
{
|
||||
require_once $path;
|
||||
|
Reference in New Issue
Block a user