<commit_before><?php
/**
 * CakePHP Migrations
 *
 * Copyright 2009 - 2013, Cake Development Corporation
 *                        1785 E. Sahara Avenue, Suite 490-423
 *                        Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright 2009 - 2013, Cake Development Corporation
 * @link      http://codaset.com/cakedc/migrations/
 * @package   plugns.migrations
 * @license   MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::uses('Shell', 'Console');
App::uses('CakeSchema', 'Model');
App::uses('MigrationVersion', 'Migrations.Lib');
App::uses('String', 'Utility');

/**
 * Migration shell.
 *
 * @package       migrations
 * @subpackage    migrations.vendors.shells
 */
class MigrationShell extends AppShell {

/**
 * Connection used
 *
 * @var string
 */
	public $connection = 'default';

/**
 * Current path to load and save migrations
 *
 * @var string
 */
	public $path;

/**
 * Type of migration, can be 'app' or a plugin name
 *
 * @var string
 */
	public $type = 'app';

/**
 * MigrationVersion instance
 *
 * @var MigrationVersion
 */
	public $Version;

/**
 * Messages used to display action being performed
 *
 * @var array
 */
	private $__messages = array();

/**
 * Override startup
 *
 * @return void
 */
	public function startup() {
		$this->out(__d('migrations', 'Cake Migration Shell'));
		$this->hr();

		if (!empty($this->params['connection'])) {
			$this->connection = $this->params['connection'];
		}

		if (!empty($this->params['plugin'])) {
			$this->type = $this->params['plugin'];
		}

		if (!isset($this->params['precheck'])) {
			$this->params['precheck'] = null;
		}

		$this->path = $this->_getPath() . 'Config' . DS . 'Migration' . DS;

		$this->Version =& new MigrationVersion(array(
			'precheck' => $this->params['precheck'],
			'connection' => $this->connection,
			'autoinit' => !$this->params['no-auto-init']));

		$this->__messages = array(
			'create_table' => __d('migrations', 'Creating table :table.'),
			'drop_table' => __d('migrations', 'Dropping table :table.'),
			'rename_table' => __d('migrations', 'Renaming table :old_name to :new_name.'),
			'add_field' => __d('migrations', 'Adding field :field to :table.'),
			'drop_field' => __d('migrations', 'Dropping field :field from :table.'),<commit_msg>Making the pre-check the default behavior for the shell<commit_after><?php
/**
 * CakePHP Migrations
 *
 * Copyright 2009 - 2013, Cake Development Corporation
 *                        1785 E. Sahara Avenue, Suite 490-423
 *                        Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright 2009 - 2013, Cake Development Corporation
 * @link      http://codaset.com/cakedc/migrations/
 * @package   plugns.migrations
 * @license   MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::uses('Shell', 'Console');
App::uses('CakeSchema', 'Model');
App::uses('MigrationVersion', 'Migrations.Lib');
App::uses('String', 'Utility');

/**
 * Migration shell.
 *
 * @package       migrations
 * @subpackage    migrations.vendors.shells
 */
class MigrationShell extends AppShell {

/**
 * Connection used
 *
 * @var string
 */
	public $connection = 'default';

/**
 * Current path to load and save migrations
 *
 * @var string
 */
	public $path;

/**
 * Type of migration, can be 'app' or a plugin name
 *
 * @var string
 */
	public $type = 'app';

/**
 * MigrationVersion instance
 *
 * @var MigrationVersion
 */
	public $Version;

/**
 * Messages used to display action being performed
 *
 * @var array
 */
	private $__messages = array();

/**
 * Override startup
 *
 * @return void
 */
	public function startup() {
		$this->out(__d('migrations', 'Cake Migration Shell'));
		$this->hr();

		if (!empty($this->params['connection'])) {
			$this->connection = $this->params['connection'];
		}

		if (!empty($this->params['plugin'])) {
			$this->type = $this->params['plugin'];
		}

		if (!isset($this->params['precheck'])) {
			$this->params['precheck'] = 'condition';
		}

		$this->path = $this->_getPath() . 'Config' . DS . 'Migration' . DS;

		$this->Version =& new MigrationVersion(array(
			'precheck' => $this->params['precheck'],
			'connection' => $this->connection,
			'autoinit' => !$this->params['no-auto-init']));

		$this->__messages = array(
			'create_table' => __d('migrations', 'Creating table :table.'),
			'drop_table' => __d('migrations', 'Dropping table :table.'),
			'rename_table' => __d('migrations', 'Renaming table :old_name to :new_name.'),
			'add_field' => __d('migrations', 'Adding field :field to :table.'),
			'drop_field' => __d('migrations', 'Dropping field :field from :table.'),
{'fraction_non_alphanumeric': 0.17718092858630022, 'fraction_numerical': 0.012908598792421403, 'mean_word_length': 3.592734225621415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4020720', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1507, 'n_words': 383}