<commit_before><?php
/**
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 2.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Console\Command;

use Cake\Console\Shell;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Utility\Folder;
use Cake\Utility\Inflector;

/**
 * A shell class to help developers upgrade applications to CakePHP 3.0
 *
 */
class UpgradeShell extends Shell {

/**
 * Files
 *
 * @var array
 */
	protected $_files = [];

/**
 * Paths
 *
 * @var array
 */
	protected $_paths = [];

/**
 * Shell startup, prints info message about dry run.
 *
 * @return void
 */
	public function startup() {
		parent::startup();
		if ($this->params['dryRun']) {
			$this->out(__d('cake_console', '<warning>Dry-run mode enabled!</warning>'), 1, Shell::QUIET);
		}
	}

/**
 * Run all upgrade steps one at a time.
 *
 * @return void
 */
	public function all() {
		foreach ($this->OptionParser->subcommands() as $command) {
			$name = $command->name();
			if ($name === 'all') {
				continue;
			}
			$this->out(__d('cake_console', 'Running %s', $name));
			$this->$name();
		}
	}

/**
 * Move files and folders to their new homes.
 *
 * @return void
 */
	public function locations() {
		$path = $this->_getPath();

		$moves = [
			'Test' . DS . 'Case' => 'Test' . DS . 'TestCase',
			'View' . DS . 'Elements' => 'View' . DS . 'Element',
			'View' . DS . 'Emails' => 'View' . DS . 'Email',
			'View' . DS . 'Layouts' => 'View' . DS . 'Layout',
			'View' . DS . 'Layout' . DS . 'Emails' => 'View' . DS . 'Layout' . DS . 'Email',
			'View' . DS . 'Scaffolds' => 'View' . DS . 'Scaffold',
			'View' . DS . 'Errors' => 'View' . DS . 'Error',
		];
		$dry = $this->params['dryRun'];

		foreach ($moves as $old => $new) {
			$old = $path . DS . $old;
			$new = $path . DS . $new;
			if (!is_dir($old)) {
				continue;
			}
			$this->out(__d('cake_console', '<info>Moving %s to %s</info>', $old, $new));
			if ($dry) {
				continue;
			}
			if ($this->params['git']) {<commit_msg>Updated upgrade shell template/view files location change.<commit_after><?php
/**
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 2.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Console\Command;

use Cake\Console\Shell;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Utility\Folder;
use Cake\Utility\Inflector;

/**
 * A shell class to help developers upgrade applications to CakePHP 3.0
 *
 */
class UpgradeShell extends Shell {

/**
 * Files
 *
 * @var array
 */
	protected $_files = [];

/**
 * Paths
 *
 * @var array
 */
	protected $_paths = [];

/**
 * Shell startup, prints info message about dry run.
 *
 * @return void
 */
	public function startup() {
		parent::startup();
		if ($this->params['dryRun']) {
			$this->out(__d('cake_console', '<warning>Dry-run mode enabled!</warning>'), 1, Shell::QUIET);
		}
	}

/**
 * Run all upgrade steps one at a time.
 *
 * @return void
 */
	public function all() {
		foreach ($this->OptionParser->subcommands() as $command) {
			$name = $command->name();
			if ($name === 'all') {
				continue;
			}
			$this->out(__d('cake_console', 'Running %s', $name));
			$this->$name();
		}
	}

/**
 * Move files and folders to their new homes.
 *
 * @return void
 */
	public function locations() {
		$path = $this->_getPath();

		$moves = [
			'Test' . DS . 'Case' => 'Test' . DS . 'TestCase',
			'View' . DS . 'Elements' => 'Template' . DS . 'Element',
			'View' . DS . 'Emails' => 'Template' . DS . 'Email',
			'View' . DS . 'Layouts' => 'Template' . DS . 'Layout',
			'Template' . DS . 'Layout' . DS . 'Emails' => 'Template' . DS . 'Layout' . DS . 'Email',
			'View' . DS . 'Scaffolds' => 'Template' . DS . 'Scaffold',
			'View' . DS . 'Errors' => 'Template' . DS . 'Error',
			'View' . DS . 'Themed' => 'Template' . DS . 'Themed',
		];
		$dry = $this->params['dryRun'];

		$this->out('<info>Creating "Template" folder</info>');
		if (!$dry) {
			mkdir('Template');
		}

		foreach ($moves as $old => $new) {
			$old = $path . DS . $old;
			$new = $path . DS . $new;
			if (!is_dir($old)) {
				continue;
			}
			$this->out(__d('cake_console', '<info>Moving %s to %s</info>', $old, $new));
			if ($dry) {
				continue;
			}
			if ($this->params['git']) {
{'fraction_non_alphanumeric': 0.19074252651880425, 'fraction_numerical': 0.0019286403085824494, 'mean_word_length': 2.9618029029793735, 'pattern_counts': {'":': 0, '<': 15, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5091359', 'n_tokens_mistral': 1943, 'n_tokens_neox': 1756, 'n_words': 490}