<commit_before><?php
$VERSION = "2.2.2";
$old_version = get_config("clipit_version");

print_r("<p>Current version: $old_version<br>New version: $VERSION</p>");

if($VERSION === $old_version) return;

// list of update files for each version
$update_files = array(
    "2.2.0" => null,
    "2.2.1" => "update_2.2.1.php",
    "2.2.2" => "update_2.2.2.php",
    // add here future updates: version => file
);

if(!empty($old_version)) {
    // advance until old version
    while (key($update_files) != $old_version) {
        next($update_files);
    }
    // skip old version update file
    next($update_files);
}
// apply all updates from there onwards
while(key($update_files) != null){
    $value = current($update_files);
    if(!empty($value)){
        include_once((string)$value);
        print_r("<p>Applied patch: $value</p>");
    }
    next($update_files);
};
set_config("clipit_version", $VERSION);
print_r("<p>Updated to version: $VERSION</p>");


<commit_msg>added new update patch to reload reflection_palette<commit_after><?php
$VERSION = "2.2.2";
$old_version = get_config("clipit_version");

// If no clipit_version in config, then it's a new install, set the version and exit.
if(empty($old_version)){
    set_config("clipit_version", $VERSION);
    return;
}

print_r("<p>Current version: $old_version<br>New version: $VERSION</p>");

if($VERSION === $old_version) return;

// list of update files for each version
$update_files = array(
    "2.2.0" => null,
    "2.2.1" => "update_2.2.1.php",
    "2.2.2" => "update_2.2.2.php",
    // add here future updates: version => file
);

if(!empty($old_version)) {
    // advance until old version
    while (key($update_files) != $old_version) {
        next($update_files);
    }
    // skip old version update file
    next($update_files);
}
// apply all updates from there onwards
while(key($update_files) != null){
    $value = current($update_files);
    if(!empty($value)){
        include_once((string)$value);
        print_r("<p>Applied patch: $value</p>");
    }
    next($update_files);
};
set_config("clipit_version", $VERSION);
print_r("<p>Updated to version: $VERSION</p>");



{'fraction_non_alphanumeric': 0.1794990723562152, 'fraction_numerical': 0.016697588126159554, 'mean_word_length': 3.836322869955157, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '1072657', 'n_tokens_mistral': 742, 'n_tokens_neox': 734, 'n_words': 167}