<commit_before><?php

use UMA\BicingStats\Postgres\Mapper;

date_default_timezone_set('Europe/Andorra');

require_once __DIR__ . '/../vendor/autoload.php';

$cnt = new \Slim\Container(['settings' => require_once __DIR__ . '/settings.php']);

$cnt['paths.root'] = realpath(__DIR__ . '/..');
$cnt['paths.datastore'] = $cnt['paths.root'] . '/var/data';

$cnt[\PDO::class] = function ($cnt) {
    return new \PDO($cnt['settings']['pdo']['dsn'], null, null, [
        \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
        \PDO::ATTR_EMULATE_PREPARES => false,
        \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
    ]);
};

$cnt[Mapper::class] = function ($cnt) {
    return new Mapper($cnt[\PDO::class]);
};

return $cnt;<commit_msg>set timezone on PDO client too<commit_after><?php

use UMA\BicingStats\Postgres\Mapper;

require_once __DIR__ . '/../vendor/autoload.php';


define('BCN_TIMEZONE', 'Europe/Andorra');
date_default_timezone_set(BCN_TIMEZONE);

$cnt = new \Slim\Container(['settings' => require_once __DIR__ . '/settings.php']);

$cnt['paths.root'] = realpath(__DIR__ . '/..');
$cnt['paths.datastore'] = $cnt['paths.root'] . '/var/data';

$cnt[\PDO::class] = function ($cnt) {
    $pdo = new \PDO($cnt['settings']['pdo']['dsn'], null, null, [
        \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
        \PDO::ATTR_EMULATE_PREPARES => false,
        \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
    ]);

    $pdo->exec(sprintf("SET TIMEZONE TO '%s'", BCN_TIMEZONE));

    return $pdo;
};

$cnt[Mapper::class] = function ($cnt) {
    return new Mapper($cnt[\PDO::class]);
};

return $cnt;
{'fraction_non_alphanumeric': 0.21215880893300249, 'fraction_numerical': 0.0, 'mean_word_length': 4.341059602649007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '7098494', 'n_tokens_mistral': 620, 'n_tokens_neox': 611, 'n_words': 93}