mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 17:24:07 +00:00
Prepare for embedded mode
This commit is contained in:
13
app.php
13
app.php
@@ -6,8 +6,17 @@ use \Psr\Http\Message\ResponseInterface as Response;
|
||||
use \Grocy\Helpers\UrlManager;
|
||||
use \Grocy\Controllers\LoginController;
|
||||
|
||||
if (file_exists(__DIR__ . '/embedded.txt'))
|
||||
{
|
||||
define('DATAPATH', file_get_contents(__DIR__ . '/embedded.txt'));
|
||||
}
|
||||
else
|
||||
{
|
||||
define('DATAPATH', __DIR__ . '/data');
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
require_once __DIR__ . '/data/config.php';
|
||||
require_once DATAPATH . '/config.php';
|
||||
require_once __DIR__ . '/config-dist.php'; //For not in own config defined values we use the default ones
|
||||
|
||||
// Setup base application
|
||||
@@ -18,7 +27,7 @@ $appContainer = new \Slim\Container([
|
||||
],
|
||||
'view' => function($container)
|
||||
{
|
||||
return new \Slim\Views\Blade(__DIR__ . '/views', __DIR__ . '/data/viewcache');
|
||||
return new \Slim\Views\Blade(__DIR__ . '/views', DATAPATH . '/viewcache');
|
||||
},
|
||||
'LoginControllerInstance' => function($container)
|
||||
{
|
||||
|
Reference in New Issue
Block a user