mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Use custom demo DB path suffix also for storage (references #395)
This commit is contained in:
@@ -290,10 +290,23 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
$batteriesService->TrackChargeCycle(4, date('Y-m-d H:i:s', strtotime('-56 days')));
|
$batteriesService->TrackChargeCycle(4, date('Y-m-d H:i:s', strtotime('-56 days')));
|
||||||
|
|
||||||
// Download demo storage data
|
// Download demo storage data
|
||||||
$productPicturesFolder = GROCY_DATAPATH . '/storage/productpictures';
|
$storagePath = GROCY_DATAPATH . '/storage';
|
||||||
$equipmentManualsFolder = GROCY_DATAPATH . '/storage/equipmentmanuals';
|
@mkdir($storagePath);
|
||||||
$recipePicturesFolder = GROCY_DATAPATH . '/storage/recipepictures';
|
if (GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease')
|
||||||
@mkdir(GROCY_DATAPATH . '/storage');
|
{
|
||||||
|
$dbSuffix = GROCY_DEFAULT_LOCALE;
|
||||||
|
if (defined('GROCY_DEMO_DB_SUFFIX'))
|
||||||
|
{
|
||||||
|
$dbSuffix = GROCY_DEMO_DB_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
$storagePath = $storagePath . '/' . $dbSuffix;
|
||||||
|
@mkdir($storagePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
$productPicturesFolder = $storagePath . '/productpictures';
|
||||||
|
$equipmentManualsFolder = $storagePath . '/equipmentmanuals';
|
||||||
|
$recipePicturesFolder = $storagePath . '/recipepictures';
|
||||||
@mkdir($productPicturesFolder);
|
@mkdir($productPicturesFolder);
|
||||||
@mkdir($equipmentManualsFolder);
|
@mkdir($equipmentManualsFolder);
|
||||||
@mkdir($recipePicturesFolder);
|
@mkdir($recipePicturesFolder);
|
||||||
|
@@ -76,5 +76,21 @@ class FilesService extends BaseService
|
|||||||
{
|
{
|
||||||
mkdir($this->StoragePath);
|
mkdir($this->StoragePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease')
|
||||||
|
{
|
||||||
|
$dbSuffix = GROCY_DEFAULT_LOCALE;
|
||||||
|
if (defined('GROCY_DEMO_DB_SUFFIX'))
|
||||||
|
{
|
||||||
|
$dbSuffix = GROCY_DEMO_DB_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->StoragePath = $this->StoragePath . '/' . $dbSuffix;
|
||||||
|
|
||||||
|
if (!file_exists($this->StoragePath))
|
||||||
|
{
|
||||||
|
mkdir($this->StoragePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user