<commit_before><?php
/**
 * Copyright (C) 2015 <NAME>
 *
 * Defines the environment config
 */
use Opulence\Applications\Environments\Environment;
use Opulence\Applications\Environments\EnvironmentDetector;
use Opulence\Applications\Environments\Hosts\HostRegex;

/**
 * ----------------------------------------------------------
 * Register the hosts
 * ----------------------------------------------------------
 */
$detector = new EnvironmentDetector();
$detector->registerHost("production", [
    // Add any production hosts here
    new HostRegex("^.*$")
]);
$detector->registerHost("staging", [
    // Add any staging hosts here
]);
$detector->registerHost("testing", [
    // Add any testing hosts here
]);
$detector->registerHost("development", [
    // Add any development hosts here
]);
$environmentName = $detector->detect();
$environment = new Environment($environmentName);

/**
 * ----------------------------------------------------------
 * Load environment variables for non-production environments
 * ----------------------------------------------------------
 *
 * Note:  For performance in production, it's highly suggested
 * you set environment variables on the server itself
 */
foreach (glob(__DIR__ . "/environment/.env.*.php") as $environmentFile) {
    if (basename($environmentFile) != ".env.example.php") {
        require $environmentFile;
    }
}

return $environment;<commit_msg>Updated to use latest environment resolver<commit_after><?php
/**
 * Copyright (C) 2015 <NAME>
 *
 * Defines the environment config
 */
use Opulence\Applications\Environments\Environment;
use Opulence\Applications\Environments\Hosts\HostRegex;
use Opulence\Applications\Environments\Resolvers\EnvironmentResolver;

/**
 * ----------------------------------------------------------
 * Register the hosts
 * ----------------------------------------------------------
 */
$environmentResolver = new EnvironmentResolver();
$environmentResolver->registerHost("production", [
    // Add any production hosts here
    new HostRegex("^.*$")
]);
$environmentResolver->registerHost("staging", [
    // Add any staging hosts here
]);
$environmentResolver->registerHost("testing", [
    // Add any testing hosts here
]);
$environmentResolver->registerHost("development", [
    // Add any development hosts here
]);
$environment = new Environment($environmentResolver->resolve(gethostname()));

/**
 * ----------------------------------------------------------
 * Load environment variables for non-production environments
 * ----------------------------------------------------------
 *
 * Note:  For performance in production, it's highly suggested
 * you set environment variables on the server itself
 */
foreach (glob(__DIR__ . "/environment/.env.*.php") as $environmentFile) {
    if (basename($environmentFile) != ".env.example.php") {
        require $environmentFile;
    }
}

return $environment;
{'fraction_non_alphanumeric': 0.2737603305785124, 'fraction_numerical': 0.0027548209366391185, 'mean_word_length': 2.1783369803063457, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '1036995', 'n_tokens_mistral': 679, 'n_tokens_neox': 649, 'n_words': 174}