<commit_before><?php

use Zork\Patcher\Patcher;
use Zork\Iterator\CallbackMapIterator;

include './init.php';

$paths = new CallbackMapIterator(
    new CallbackFilterIterator(
        new RecursiveIteratorIterator(
            new RecursiveCallbackFilterIterator(
                new RecursiveDirectoryIterator(
                    './vendor',
                    RecursiveDirectoryIterator::CURRENT_AS_SELF |
                    RecursiveDirectoryIterator::KEY_AS_FILENAME |
                    RecursiveDirectoryIterator::SKIP_DOTS |
                    RecursiveDirectoryIterator::UNIX_PATHS
                ),
                function ( $current, $key ) {
                    return '.' !== $key[0];
                }
            ),
            RecursiveIteratorIterator::SELF_FIRST
        ),
        function ( $current, $key ) {
            return $current->isDir() && $key === 'sql' &&
                   preg_match( '#[^/]+/[^/]+/(module/[^/]+/)?sql$#', $current->getSubPathname() );
        }
    ),
    function ( $current ) {
        return './vendor/' . $current->getSubPathname();
    },
    CallbackMapIterator::FLAG_GENERATE_KEYS
);

$config  = require './config/autoload/db.local.php';
$patcher = new Patcher( $config['db'] );
$patcher->patch( $paths );
<commit_msg>patcher update<commit_after><?php

use Grid\Installer\Patcher;
use Zork\Iterator\CallbackMapIterator;

include './init.php';

$paths = new CallbackMapIterator(
    new CallbackFilterIterator(
        new RecursiveIteratorIterator(
            new RecursiveCallbackFilterIterator(
                new RecursiveDirectoryIterator(
                    './vendor',
                    RecursiveDirectoryIterator::CURRENT_AS_SELF |
                    RecursiveDirectoryIterator::KEY_AS_FILENAME |
                    RecursiveDirectoryIterator::SKIP_DOTS |
                    RecursiveDirectoryIterator::UNIX_PATHS
                ),
                function ( $current, $key ) {
                    return '.' !== $key[0];
                }
            ),
            RecursiveIteratorIterator::SELF_FIRST
        ),
        function ( $current, $key ) {
            return $current->isDir() && $key === 'sql' &&
                   preg_match( '#[^/]+/[^/]+/(module/[^/]+/)?sql$#', $current->getSubPathname() );
        }
    ),
    function ( $current ) {
        return './vendor/' . $current->getSubPathname();
    },
    CallbackMapIterator::FLAG_GENERATE_KEYS
);

$config  = require './config/autoload/db.local.php';
$patcher = new Patcher( (array) $config['db'] );
$patcher->patch( $paths );

{'fraction_non_alphanumeric': 0.1364870104691741, 'fraction_numerical': 0.0007754943776657619, 'mean_word_length': 1.9689298043728423, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7423967', 'n_tokens_mistral': 743, 'n_tokens_neox': 709, 'n_words': 110}