<commit_before><?php

require_once(__DIR__ . "/autoload.php");

use \UniEngine\Utils\Migrations as Migrations;

if (PHP_SAPI !== "cli") {
    throw new Exception("Migrator utility can only be run from 'cli' environment");
}

$migrator = new Migrations\Migrator([
    "rootPath" => "./"
]);

$migrator->runMigration([
    "wasManualActionConfirmed" => in_array("--confirm-manual-action", $argv)
]);

?><commit_msg>Migrator should take commands and be able to generate new migration files<commit_after><?php

require_once(__DIR__ . "/autoload.php");

use \UniEngine\Utils\Migrations as Migrations;

if (PHP_SAPI !== "cli") {
    throw new \Exception("Migrator utility can only be run from 'cli' environment");
}

$migrator = new Migrations\Migrator([
    "rootPath" => "./"
]);

$cmd = $argv[1];

switch ($cmd) {
    case "migrate:run":
        $migrator->runMigration([
            "wasManualActionConfirmed" => in_array(
                "--confirm-manual-action",
                $argv
            )
        ]);

        break;
    case "migrate:make":
        $migrator->generateNewMigration([
            "name" => (
                !empty($argv[2]) ?
                $argv[2] :
                null
            )
        ]);

        break;
    default:
        throw new \Exception("Invalid command \"{$cmd}\"");
}

?>
{'fraction_non_alphanumeric': 0.15658093797276854, 'fraction_numerical': 0.0022692889561270802, 'mean_word_length': 2.4274611398963732, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 13, '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': '7025249', 'n_tokens_mistral': 425, 'n_tokens_neox': 427, 'n_words': 91}