<commit_before><?php

use League\Container\Container;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Tuum\Form\Dates;
use Tuum\Form\Forms;
use Tuum\Locator\Locator;
use Tuum\View\ErrorView;
use Tuum\View\Renderer;
use Tuum\Web\Web;
use Tuum\Web\Psr7\Respond;

/** @var Container $dic */

/**
 * shared Logger
 *
 * use the de fact MonoLog.
 */
$app->set(
    Web::LOGGER, 
    function () use ($dic) {
    
        $var_dir = $dic->get(Web::VAR_DATA_DIR) . '/log/app.log';
        $logger  = new Logger('log');
        $logger->pushHandler(
            new FingersCrossedHandler(new StreamHandler($var_dir, Logger::DEBUG))
        );
        return $logger;
}, true);

/**
 * Rendering Engine (Template)
 *
 * default is Tuum's view engine.
 * use it as a singleton.
 */
$app->set(Web::RENDER_ENGINE, function() use($dic) {

    $locator = new Locator($dic->get(Web::TEMPLATE_DIR));
    if($doc_root = $dic->get(Web::DOCUMENT_DIR)) {
        // also render php documents
        $locator->addRoot($doc_root);
    }
    $renderer = new Renderer($locator);
    $renderer->register('forms', new Forms());
    $renderer->register('dates', new Dates());
    $renderer->setLayout('layout/layout');
    $view = new \Tuum\Web\View\View($renderer, new \Tuum\Web\View\Value());
    return $view;
}, true);

<commit_msg>Forms and Dates are in DataView object; removed them.<commit_after><?php

use League\Container\Container;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Tuum\Form\Dates;
use Tuum\Form\Forms;
use Tuum\Locator\Locator;
use Tuum\View\ErrorView;
use Tuum\View\Renderer;
use Tuum\Web\Web;
use Tuum\Web\Psr7\Respond;

/** @var Container $dic */

/**
 * shared Logger
 *
 * use the de fact MonoLog.
 */
$app->set(
    Web::LOGGER, 
    function () use ($dic) {
    
        $var_dir = $dic->get(Web::VAR_DATA_DIR) . '/log/app.log';
        $logger  = new Logger('log');
        $logger->pushHandler(
            new FingersCrossedHandler(new StreamHandler($var_dir, Logger::DEBUG))
        );
        return $logger;
}, true);

/**
 * Rendering Engine (Template)
 *
 * default is Tuum's view engine.
 * use it as a singleton.
 */
$app->set(Web::RENDER_ENGINE, function() use($dic) {

    $locator = new Locator($dic->get(Web::TEMPLATE_DIR));
    if($doc_root = $dic->get(Web::DOCUMENT_DIR)) {
        // also render php documents
        $locator->addRoot($doc_root);
    }
    $renderer = new Renderer($locator);
    $renderer->setLayout('layout/layout');
    $view = new \Tuum\Web\View\View($renderer, new \Tuum\Web\View\Value());
    return $view;
}, true);


{'fraction_non_alphanumeric': 0.16529543754674644, 'fraction_numerical': 0.0007479431563201197, 'mean_word_length': 3.2868589743589745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '5075482', 'n_tokens_mistral': 950, 'n_tokens_neox': 941, 'n_words': 194}