<commit_before><?php

/**
 * This is a simple script to install a locale file.
 */

require_once __DIR__ . '/../autoload.php';
require_once __DIR__ . '/../app/AppKernel.php';
require_once __DIR__ . '/../app/KernelLoader.php';

use Backend\Init as BackendInit;
use Backend\Modules\Locale\Engine\Model as BackendLocaleModel;

/*
 * The short options explained:
 * f: => file (argument required)
 * o => overwrite the locale or not? (no argument required)
 */
$shortOptions = 'f:m:o::';
$options = getopt($shortOptions);

// No file was given
if (!isset($options['f']) && !isset($options['m'])) {
    throw new Exception('We need a file or module to load our data from.');
}

// File given, check if it exists
elseif (isset($options['f'])) {
    $baseFile = $options['f'];

    if (!file_exists($baseFile)) {
        throw new Exception('The given file(' . $baseFile . ') does not exist.');
    }
}
<commit_msg>Deprecate install_locale<commit_after><?php

/**
 * This is a simple script to install a locale file.
 *
 * @deprecated
 */

trigger_error(
    'This script is deprecated
     Use app/console forkcms:locale:import instead',
    E_USER_DEPRECATED
);
require_once __DIR__ . '/../autoload.php';
require_once __DIR__ . '/../app/AppKernel.php';
require_once __DIR__ . '/../app/KernelLoader.php';

use Backend\Init as BackendInit;
use Backend\Modules\Locale\Engine\Model as BackendLocaleModel;

/*
 * The short options explained:
 * f: => file (argument required)
 * o => overwrite the locale or not? (no argument required)
 */
$shortOptions = 'f:m:o::';
$options = getopt($shortOptions);

// No file was given
if (!isset($options['f']) && !isset($options['m'])) {
    throw new Exception('We need a file or module to load our data from.');
}

// File given, check if it exists
elseif (isset($options['f'])) {
    $baseFile = $options['f'];

    if (!file_exists($baseFile)) {
        throw new Exception('The given file(' . $baseFile . ') does not exist.');
    }
}

{'fraction_non_alphanumeric': 0.16251904520060945, 'fraction_numerical': 0.0, 'mean_word_length': 3.712918660287081, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3795243', 'n_tokens_mistral': 620, 'n_tokens_neox': 624, 'n_words': 192}