<commit_before><?php

/**
 * Task which allows you to do the following:
 *
 * 1. Run migrations (i.e. "up"). Example:
 *
 * 		sake dev/tasks/MigrateTask up
 *
 * 2. Reverse previous migrations (i.e. "down"). Example:
 *
 * 		sake dev/tasks/MigrateTask down
 *
 * 3. Make a new migration file for you with boilerplate code. Example:
 *
 * 		sake dev/tasks/MigrateTask make:adding_column_to_table
 *
 * This generates a file like the following, containing the class "Migration_AddingColumnToTable":
 *
 * 		2015_01_01_12345678_name_of_your_migration.php
 *
 * IMPORTANT: This file will be automatically placed in your project directory in the path "<project>/code/migrations".
 * This can be overridden by defining an absolute path in the constant "MIGRATION_PATH" in your _ss_environment.php file.
 * Migration files that are automatically generated will be pseudo-namespaced with a "Migration_" prefix to help reduce
 * possible class name collisions.
 *
 * @author	<NAME>, <EMAIL>
 * @since	2015-02-17
 */

class MigrateTask extends BuildTask {
	protected $title = 'Database Migrations (Module)';

	protected $description = 'Performs atomic database migrations.';

	protected $enabled = true;

	/**
	 * @param	SS_HTTPRequest $request
	 */
	public function run($request) {
		// Only allow execution from the command line (for simplicity).
		if (!Director::is_cli()) {
			echo "<p>Sorry, but this can only be run from the command line.</p>";
			return;
		}

		// Get and pre-process arguments. Format: ["argument" => true, "make" => "filename", ... ]
		$getVars = $request->getVars();
		$args = [];
		if (isset($getVars["args"]) && is_array($getVars["args"])) {<commit_msg>Clearing up documentation in MigrateTask.<commit_after><?php

/**
 * Task which allows you to do the following:
 *
 * 1. Run migrations (i.e. "up"). Example:
 *
 * 		sake dev/tasks/MigrateTask up
 *
 * 2. Reverse previous migrations (i.e. "down"). Example:
 *
 * 		sake dev/tasks/MigrateTask down
 *
 * 3. Make a new migration file for you with boilerplate code. Example:
 *
 * 		sake dev/tasks/MigrateTask make:adding_column_to_table
 *
 * This generates a file like the following, containing the class "Migration_AddingColumnToTable":
 *
 * 		YYYY_MM_DD_HHMMSS_adding_column_to_table.php
 *
 * IMPORTANT: This file will be automatically placed in your project directory in the path "<project>/code/migrations".
 * This can be overridden by defining an absolute path in the constant "MIGRATION_PATH" in your _ss_environment.php file.
 * Migration files that are automatically generated will be pseudo-namespaced with a "Migration_" prefix to help reduce
 * possible class name collisions.
 *
 * @author	<NAME>, <EMAIL>
 * @since	2015-02-17
 */

class MigrateTask extends BuildTask {
	protected $title = 'Database Migrations (Module)';

	protected $description = 'Performs atomic database migrations.';

	protected $enabled = true;

	/**
	 * @param	SS_HTTPRequest $request
	 */
	public function run($request) {
		// Only allow execution from the command line (for simplicity).
		if (!Director::is_cli()) {
			echo "<p>Sorry, but this can only be run from the command line.</p>";
			return;
		}

		// Get and pre-process arguments. Format: ["argument" => true, "make" => "filename", ... ]
		$getVars = $request->getVars();
		$args = [];
		if (isset($getVars["args"]) && is_array($getVars["args"])) {
{'fraction_non_alphanumeric': 0.1201780415430267, 'fraction_numerical': 0.011275964391691394, 'mean_word_length': 3.9866863905325443, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 19, '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': '193048', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1027, 'n_words': 354}