<commit_before>#!/bin/sh

if ! hash "composer" 2>/dev/null && ! hash "composer.phar" 2>/dev/null; then
    echo '[curl] Getting Composer, the PHP dependency manager'
    curl -sS https://getcomposer.org/installer | php
    mv composeR.phar composer
fi

echo '[composer] Downloading the bundle'
composer require "gnugat/wizard-bundle:~1.0"

echo '[sed] Enabling the bundle'
sed -i 's/        }/            $bundles[] = new Gnugat\\Bundle\\WizardBundle\\GnugatWizardBundle();\n        }/' app/AppKernel.php<commit_msg>[PostInstall] Updated installer script<commit_after>#!/bin/sh

if ! hash "composer" 2>/dev/null && ! hash "composer.phar" 2>/dev/null; then
    echo '[curl] Getting Composer, the PHP dependency manager'
    curl -sS https://getcomposer.org/installer | php
    mv composeR.phar composer
fi

echo '[composer] Downloading the bundle'
composer require "gnugat/wizard-bundle:~1.0"

echo '[php] Subscribing to the post-package-install event'
php -a <<EOF
<?php
\$composerConfigFile = file_get_contents('composer.json');
\$composerConfig = json_decode(\$composerConfigFile, true);

if (!isset(\$composerConfig['scripts'])) {
    \$composerConfig['scripts'] = array();
}

if (!isset(\$composerConfig['scripts']['post-package-install'])) {
    \$composerConfig['scripts']['post-package-install'] = array();
}

\$composerConfig['scripts']['post-package-install'][] = 'Gnugat\\Bundle\\WizardBundle\\EventListener\\ComposerEvent::postPackageInstall';
\$composerConfigFile = json_encode(\$composerConfig, JSON_PRETTY_PRINT);
file_put_contents('composer.json', \$composerConfigFile);
EOF

echo '[sed] Enabling the bundle'
sed -i 's/        }/            $bundles[] = new Gnugat\\Bundle\\WizardBundle\\GnugatWizardBundle();\n        }/' app/AppKernel.php
{'fraction_non_alphanumeric': 0.1623931623931624, 'fraction_numerical': 0.004558404558404558, 'mean_word_length': 4.353658536585366, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5475337', 'n_tokens_mistral': 597, 'n_tokens_neox': 569, 'n_words': 124}