<commit_before><?php

/**
 * Dependency injection
 *
 * @author	<NAME> <<EMAIL>>
 */

$container = $app->getContainer();

// 404 Handler
$container['notFoundHandler'] = function(\Slim\Container $c) {
    return function() use ($c) {
        return $c['response']
            ->withStatus(404)
            ->withHeader('Content-Type', 'text/html')
            ->write('Page not found');
    };
};

$container['renderer'] = function (\Slim\Container $c) {
    $settings = $c->get('settings');
    $renderer = new \Slim\Views\Twig($settings['renderer']['template_path'], [
        'cache' => $settings['renderer']['cache_path']
    ]);

    $renderer->addExtension(new Slim\Views\TwigExtension($c['router'], $settings['web_root']));
    $renderer->offsetSet('settings', $settings);
    return $renderer;
};<commit_msg>Update to current VSMS-Core<commit_after><?php

/**
 * Dependency injection
 *
 * @author	<NAME> <<EMAIL>>
 */

$container = $app->getContainer();

// 404 Handler
$container['notFoundHandler'] = function(\Slim\Container $c) {
    return function() use ($c) {
        return $c['response']
            ->withStatus(404)
            ->withHeader('Content-Type', 'text/html')
            ->write('Page not found');
    };
};

// Translations
$container['i18n'] = function(\Slim\Container $c) {
    $settings = $c->get('settings');
    return new \InternetOfVoice\VSMS\Core\Helper\TranslationHelper(
        $settings['locales'],
        $settings['locale_default']
    );
};

// View renderer
$container['renderer'] = function (\Slim\Container $c) {
    $settings = $c->get('settings');
    $renderer = new \Slim\Views\Twig($settings['renderer']['template_path'], [
        'cache' => $settings['renderer']['cache_path']
    ]);

    $renderer->addExtension(new Slim\Views\TwigExtension($c['router'], $settings['web_root']));
    $renderer->offsetSet('settings', $settings);
    return $renderer;
};
{'fraction_non_alphanumeric': 0.20198848770277342, 'fraction_numerical': 0.007326007326007326, 'mean_word_length': 3.552380952380952, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2198888', 'n_tokens_mistral': 602, 'n_tokens_neox': 596, 'n_words': 102}