mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Fixed pre requisite checker paths (fixes #748)
This commit is contained in:
parent
b4a480aa37
commit
356cdf4991
15
app.php
15
app.php
@ -8,19 +8,6 @@ use Slim\Factory\AppFactory;
|
||||
use Grocy\Helpers\UrlManager;
|
||||
use Grocy\Controllers\LoginController;
|
||||
|
||||
// Definitions for embedded mode
|
||||
if (file_exists(__DIR__ . '/embedded.txt'))
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', true);
|
||||
define('GROCY_DATAPATH', file_get_contents(__DIR__ . '/embedded.txt'));
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', false);
|
||||
define('GROCY_DATAPATH', __DIR__ . '/data');
|
||||
}
|
||||
|
||||
// Load composer dependencies
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
@ -29,7 +16,7 @@ require_once GROCY_DATAPATH . '/config.php';
|
||||
require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones
|
||||
|
||||
// Definitions for dev/demo/prerelease mode
|
||||
if (GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease')
|
||||
if ((GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease') && !defined('GROCY_USER_ID'))
|
||||
{
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ class PrerequisiteChecker
|
||||
|
||||
private function checkForConfigFile()
|
||||
{
|
||||
if (!file_exists(__DIR__ . '/../data/config.php'))
|
||||
if (!file_exists(GROCY_DATAPATH . '/config.php'))
|
||||
{
|
||||
throw new ERequirementNotMet('/data/config.php not found. Have you copied config-dist.php to the data directory and renamed it to config.php?');
|
||||
throw new ERequirementNotMet('config.php in data directory (' . GROCY_DATAPATH . ') not found. Have you copied config-dist.php to the data directory and renamed it to config.php?');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,18 @@
|
||||
<?php
|
||||
|
||||
// Definitions for embedded mode
|
||||
if (file_exists(__DIR__ . '/../embedded.txt'))
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', true);
|
||||
define('GROCY_DATAPATH', file_get_contents(__DIR__ . '/../embedded.txt'));
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', false);
|
||||
define('GROCY_DATAPATH', __DIR__ . '/../data');
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../helpers/PrerequisiteChecker.php';
|
||||
|
||||
try
|
||||
|
Loading…
x
Reference in New Issue
Block a user