<commit_before><?php
define('C5_ENVIRONMENT_ONLY', true);

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
ini_set('display_errors', 1);
define('C5_EXECUTE', true);
if(isset($argv) && is_array($argv) && isset($argv[1])) {
    define('DIR_BASE', $argv[1]);
}
else {
    define('DIR_BASE', dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'web');
}
$corePath = DIR_BASE . '/concrete';
$cms = require_once $corePath . '/dispatcher.php';

$generator = new \Concrete\Core\Support\JSConstantGenerator( $constants );
$constants = $generator->render();

$js =  "$(function(){ Concrete.const = $constants; })\n";

file_put_contents(DIR_BASE . '/concrete/js/build/core/app/concrete5-const.js', $js);

die("JS Generation Complete.\n");
<commit_msg>added 'do not edit' warning<commit_after><?php
define('C5_ENVIRONMENT_ONLY', true);

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
ini_set('display_errors', 1);
define('C5_EXECUTE', true);
if(isset($argv) && is_array($argv) && isset($argv[1])) {
    define('DIR_BASE', $argv[1]);
}
else {
    define('DIR_BASE', dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'web');
}
$corePath = DIR_BASE . '/concrete';
$cms = require_once $corePath . '/dispatcher.php';

$generator = new \Concrete\Core\Support\JSConstantGenerator( $constants );
$constants = $generator->render();

$js =  "// GENERATED FILE DO NOT MODIFY (see grunt generate-constants target), DO NOT EDIT THIS FILE, MODIFICATIONS WILL BE LOST!!\n$(function(){ Concrete.const = $constants; })\n";

file_put_contents(DIR_BASE . '/concrete/js/build/core/app/concrete5-const.js', $js);

die("JS Generation Complete.\n");

{'fraction_non_alphanumeric': 0.18967587034813926, 'fraction_numerical': 0.007202881152460984, 'mean_word_length': 6.033755274261603, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6944934', 'n_tokens_mistral': 605, 'n_tokens_neox': 604, 'n_words': 111}