mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Prefix all global vars
This commit is contained in:
@@ -9,7 +9,7 @@ class ApplicationService extends BaseService
|
||||
*/
|
||||
public function IsDemoInstallation()
|
||||
{
|
||||
return file_exists(DATAPATH . '/demo.txt');
|
||||
return file_exists(GROCY_DATAPATH . '/demo.txt');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -11,7 +11,7 @@ class BaseService
|
||||
$this->DatabaseService = new DatabaseService();
|
||||
$this->Database = $this->DatabaseService->GetDbConnection();
|
||||
|
||||
$localizationService = new LocalizationService(CULTURE);
|
||||
$localizationService = new LocalizationService(GROCY_CULTURE);
|
||||
$this->LocalizationService = $localizationService;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ class DatabaseService
|
||||
{
|
||||
if ($this->DbConnectionRaw == null)
|
||||
{
|
||||
$pdo = new \PDO('sqlite:' . DATAPATH . '/grocy.db');
|
||||
$pdo = new \PDO('sqlite:' . GROCY_DATAPATH . '/grocy.db');
|
||||
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
||||
$this->DbConnectionRaw = $pdo;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ class DemoDataGeneratorService extends BaseService
|
||||
{
|
||||
public function PopulateDemoData()
|
||||
{
|
||||
$localizationService = new LocalizationService(CULTURE);
|
||||
$localizationService = new LocalizationService(GROCY_CULTURE);
|
||||
|
||||
$rowCount = $this->DatabaseService->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = -1')->fetchColumn();
|
||||
if (intval($rowCount) === 0)
|
||||
@@ -125,7 +125,7 @@ class DemoDataGeneratorService extends BaseService
|
||||
|
||||
public function RecreateDemo()
|
||||
{
|
||||
unlink(DATAPATH . '/grocy.db');
|
||||
unlink(GROCY_DATAPATH . '/grocy.db');
|
||||
$this->PopulateDemoData();
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class LocalizationService
|
||||
|
||||
private function LogMissingLocalization(string $culture, string $text)
|
||||
{
|
||||
$file = DATAPATH . "/missing_translations_$culture.json";
|
||||
$file = GROCY_DATAPATH . "/missing_translations_$culture.json";
|
||||
|
||||
$missingTranslations = array();
|
||||
if (file_exists($file))
|
||||
@@ -57,7 +57,7 @@ class LocalizationService
|
||||
|
||||
public function Localize(string $text, ...$placeholderValues)
|
||||
{
|
||||
if (MODE === 'dev')
|
||||
if (GROCY_MODE === 'dev')
|
||||
{
|
||||
if (!array_key_exists($text, $this->StringsDefaultCulture))
|
||||
{
|
||||
|
@@ -216,13 +216,13 @@ class StockService extends BaseService
|
||||
|
||||
private function LoadBarcodeLookupPlugin()
|
||||
{
|
||||
$pluginName = defined('STOCK_BARCODE_LOOKUP_PLUGIN') ? STOCK_BARCODE_LOOKUP_PLUGIN : '';
|
||||
$pluginName = defined('GROCY_STOCK_BARCODE_LOOKUP_PLUGIN') ? GROCY_STOCK_BARCODE_LOOKUP_PLUGIN : '';
|
||||
if (empty($pluginName))
|
||||
{
|
||||
throw new \Exception('No barcode lookup plugin defined');
|
||||
}
|
||||
|
||||
$path = DATAPATH . "/plugins/$pluginName.php";
|
||||
$path = GROCY_DATAPATH . "/plugins/$pluginName.php";
|
||||
if (file_exists($path))
|
||||
{
|
||||
require_once $path;
|
||||
|
Reference in New Issue
Block a user