<commit_before><?php

// DIC configuration
use JeremyKendall\Password\Decorator\UpgradeDecorator;  

$container = $app->getContainer();

// translation settings
$container['translations'] = function ($c) {
  $locale = $c->get('settings')['locale'];
  setlocale(LC_ALL, $locale);
  $t = $c->get('settings')['translations'];
  return $t['strings'][$locale];
};

// path settings
$container['paths'] = function ($c) {
  return $c->get('settings')['paths'];
};

// fieldtypes settings
$container['fieldtypes'] = function ($c) {
  return $c->get('settings')['fieldtypes'];
};

// view renderer
$container['view'] = function ($c) {
  $settings = $c->get('settings')['view'];
  $view = new \Slim\Views\Jade($settings['template_path'], ['cache' => $settings['cache_path']]);
  return $view;
};


// monolog
$container['logger'] = function ($c) {
  $settings = $c->get('settings')['logger'];
  $logger = new Monolog\Logger('rokfor');
  $logger->pushProcessor(new Monolog\Processor\UidProcessor());
  $logger->pushHandler(new Monolog\Handler\StreamHandler($settings['path'], $settings['level']));
  return $logger;
};

// rokfor database & update paths
$container['db'] = function ($c) {
  $settings = require __DIR__ . '/../config/database.php';
  $db = new Rokfor\DB(
      $settings['host'],
      $settings['user'],
      $settings['pass'],
      $settings['dbname'],
      $settings['log'], 
      $settings['level'],
      $c->paths,
      $settings['socket'],
      $settings['port'],
      $settings['versioning']
    );
  return $db;
};

$container['redis'] = function ($c) {
  $settings = require __DIR__ . '/../config/database.php';
  return [
    'redis'      => $settings['redis'],
    'redis_ip'   => $settings['redis_ip'],
    'redis_port' => $settings['redis_port'],
    'redis_prefix' => $settings['dbname'],
  ];
};

// csrf middleware
$container['csrf'] = function ($c) {  
    return new \Slim\Csrf\Guard;  
};  


// auth middleware
$container['authAdapter'] = function ($c) {<commit_msg>changed redis config file include<commit_after><?php

// DIC configuration
use JeremyKendall\Password\Decorator\UpgradeDecorator;  

$container = $app->getContainer();

// translation settings
$container['translations'] = function ($c) {
  $locale = $c->get('settings')['locale'];
  setlocale(LC_ALL, $locale);
  $t = $c->get('settings')['translations'];
  return $t['strings'][$locale];
};

// path settings
$container['paths'] = function ($c) {
  return $c->get('settings')['paths'];
};

// fieldtypes settings
$container['fieldtypes'] = function ($c) {
  return $c->get('settings')['fieldtypes'];
};

// view renderer
$container['view'] = function ($c) {
  $settings = $c->get('settings')['view'];
  $view = new \Slim\Views\Jade($settings['template_path'], ['cache' => $settings['cache_path']]);
  return $view;
};


// monolog
$container['logger'] = function ($c) {
  $settings = $c->get('settings')['logger'];
  $logger = new Monolog\Logger('rokfor');
  $logger->pushProcessor(new Monolog\Processor\UidProcessor());
  $logger->pushHandler(new Monolog\Handler\StreamHandler($settings['path'], $settings['level']));
  return $logger;
};

// rokfor database & update paths
$container['db'] = function ($c) {
  $settings = require __DIR__ . '/../config/database.php';
  $db = new Rokfor\DB(
      $settings['host'],
      $settings['user'],
      $settings['pass'],
      $settings['dbname'],
      $settings['log'], 
      $settings['level'],
      $c->paths,
      $settings['socket'],
      $settings['port'],
      $settings['versioning']
    );
  return $db;
};

$container['redis'] = function ($c) {
  $settings = require __DIR__ . '/../config/redis.php';
  $dbsettings = require __DIR__ . '/../config/database.php';
  return [
    'redis'        => $settings['redis'],
    'redis_ip'     => $settings['redis_ip'],
    'redis_port'   => $settings['redis_port'],
    'redis_prefix' => $dbsettings['dbname'],
  ];
};

// csrf middleware
$container['csrf'] = function ($c) {  
    return new \Slim\Csrf\Guard;  
};  


// auth middleware
$container['authAdapter'] = function ($c) {
{'fraction_non_alphanumeric': 0.21841332027424093, 'fraction_numerical': 0.0, 'mean_word_length': 4.144836272040302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '7420904', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1339, 'n_words': 246}