1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-05 21:57:31 +02:00

fixed settings but

This commit is contained in:
Sebastian
2017-07-02 19:18:48 +02:00
parent 9c4bff52f3
commit b227d89e9d
378 changed files with 2820 additions and 183 deletions

View File

@@ -10,38 +10,42 @@ session_start();
* LOAD SETTINGS *
************************/
$settings = require_once( __DIR__ . '/settings.php');
$settings = require_once( __DIR__ . '/settings.php');
if(file_exists($settings['settings']['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml'))
if(file_exists($settings['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml'))
{
$yaml = new \Symfony\Component\Yaml\Parser();
$yaml = new \Symfony\Component\Yaml\Parser();
try {
$userSettings = $yaml->parse( file_get_contents($settings['settings']['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml' ) );
$userSettings = $yaml->parse( file_get_contents($settings['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml' ) );
} catch (ParseException $e) {
printf("Unable to parse the YAML string: %s", $e->getMessage());
}
$settings = array('settings' => array_merge($settings['settings'], $userSettings));
$settings = array_merge($settings, $userSettings);
$settings['themePath'] = $settings['themeBasePath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR . $settings['theme'];
}
$settings['settings'] = $settings;
/************************
* INITIATE SLIM *
************************/
$app = new \Slim\App($settings);
$app = new \Slim\App($settings);
/************************
* SLIM CONTAINER *
************************/
$container = $app->getContainer();
$container = $app->getContainer();
/************************
* LOAD TWIG *
************************/
$container['view'] = function ($container) use ($settings){
$path = array($settings['settings']['themePath'], $settings['settings']['authorPath']);
$view = new \Slim\Views\Twig( $path, [
'cache' => false,
'autoescape' => false