<commit_before><?php
/**
 * This is a place where we configure our application
 */

/**
 * Include base classes
 */
require_once __DIR__ . '/source/functions.php';
require_once __DIR__ . '/source/template.php';


/**
 * Include configuration files
 */

require_once __DIR__ . '/config/default.php';

/**
 * Setup basic events
 */
event('http.403', [], function () {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 403 Forbidden');
    echo 'You are not logged in, please <a href="login">login</a> first';
});

event('http.404', [], function ($path) {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 404 Not Found');
    echo sprintf("Path '%s' not found", $path);
});

event('http.500', [], function (Exception $exception) {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 500 Internal Server Error');
    echo sprintf("Something went wrong, got exception with message '%s'", $exception->getMessage());
});
router('/', function () {echo "Hello world!";});
<commit_msg>added check for database config file<commit_after><?php
/**
 * This is a place where we configure our application
 */

/**
 * Include base classes
 */
require_once __DIR__ . '/source/functions.php';
require_once __DIR__ . '/source/template.php';


/**
 * Include configuration files
 */

require_once __DIR__ . '/config/default.php';
if (!is_file(__DIR__ . '/config/database.php')) {
    $message  =sprintf("File '%s' is missing please copy and rename '%s' to '%s'", __DIR__ . '/config/database.php',__DIR__ . '/config/database.example.php', __DIR__ . '/config/database.php');
    die($message);
}
/**
 * Setup basic events
 */
event('http.403', [], function () {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 403 Forbidden');
    echo 'You are not logged in, please <a href="login">login</a> first';
});

event('http.404', [], function ($path) {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 404 Not Found');
    echo sprintf("Path '%s' not found", $path);
});

event('http.500', [], function (Exception $exception) {
    header('Content-Type:text/html;charset=utf-8');
    header('HTTP/1.0 500 Internal Server Error');
    echo sprintf("Something went wrong, got exception with message '%s'", $exception->getMessage());
});
router('/', function () {
    echo "Hello world!";
});

{'fraction_non_alphanumeric': 0.1913372582001682, 'fraction_numerical': 0.022708158116063918, 'mean_word_length': 4.105150214592275, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '51728', 'n_tokens_mistral': 767, 'n_tokens_neox': 737, 'n_words': 192}