<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         3.0.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Upgrade\Shell\Task;

use Cake\Console\Shell;

/**
 * Create and setup missing files and folders via app repo.
 */
class SkeletonTask extends BaseTask {

	use ChangeTrait;

	/**
	 * @var array
	 */
	public $tasks = ['Stage'];

	/**
	 * Add missing files and folders in the root app dir.
	 *
	 * @param string $path
	 * @return bool
	 */
	protected function _process($path) {
		$path = dirname($path) . DS;

		$dirs = ['logs', 'bin', 'config', 'webroot', 'tests'];
		foreach ($dirs as $dir) {
			if (!is_dir($path . $dir) && empty($this->params['dry-run'])) {
				mkdir($path . DS . $dir, 0770, true);
			}
		}

		if (!is_file($path . 'logs' . DS . 'empty') && empty($this->params['dry-run'])) {
			touch($path . 'logs' . DS . 'empty');
		}

		$sourcePath = ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'app' . DS;
		$files = [
			'bin' . DS . 'cake',
			'bin' . DS . 'cake.bat',
			'bin' . DS . 'cake.php',
			'phpunit.xml.dist',
			'index.php',
			'webroot' . DS . 'index.php',
			'config' . DS . 'bootstrap.php',
			'config' . DS . 'bootstrap_cli.php',
			'config' . DS . 'paths.php',
			'config' . DS . 'routes.php',
			'tests' . DS . 'bootstrap.php',
			'src' . DS . 'Application.php',
			'src' . DS . 'Template' . DS . 'Error' . DS . 'error400.ctp',
			'src' . DS . 'Template' . DS . 'Error' . DS . 'error500.ctp',
			'src' . DS . 'Template' . DS . 'Layout' . DS . 'error.ctp',
			'src' . DS . 'Controller' . DS . 'PagesController.php',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'default.ctp',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'error.ctp',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'success.ctp',
		];
		$ret = 0;
		foreach ($files as $file) {
			$ret |= $this->_addFile($file, $sourcePath, $path);<commit_msg>Add AppView<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         3.0.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Upgrade\Shell\Task;

use Cake\Console\Shell;

/**
 * Create and setup missing files and folders via app repo.
 */
class SkeletonTask extends BaseTask {

	use ChangeTrait;

	/**
	 * @var array
	 */
	public $tasks = ['Stage'];

	/**
	 * Add missing files and folders in the root app dir.
	 *
	 * @param string $path
	 * @return bool
	 */
	protected function _process($path) {
		$path = dirname($path) . DS;

		$dirs = ['logs', 'bin', 'config', 'webroot', 'tests'];
		foreach ($dirs as $dir) {
			if (!is_dir($path . $dir) && empty($this->params['dry-run'])) {
				mkdir($path . DS . $dir, 0770, true);
			}
		}

		if (!is_file($path . 'logs' . DS . 'empty') && empty($this->params['dry-run'])) {
			touch($path . 'logs' . DS . 'empty');
		}

		$sourcePath = ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'app' . DS;
		$files = [
			'bin' . DS . 'cake',
			'bin' . DS . 'cake.bat',
			'bin' . DS . 'cake.php',
			'phpunit.xml.dist',
			'index.php',
			'webroot' . DS . 'index.php',
			'config' . DS . 'bootstrap.php',
			'config' . DS . 'bootstrap_cli.php',
			'config' . DS . 'paths.php',
			'config' . DS . 'routes.php',
			'tests' . DS . 'bootstrap.php',
			'src' . DS . 'Application.php',
			'src' . DS . 'View' . DS . 'AppView.php',
			'src' . DS . 'Template' . DS . 'Error' . DS . 'error400.ctp',
			'src' . DS . 'Template' . DS . 'Error' . DS . 'error500.ctp',
			'src' . DS . 'Template' . DS . 'Layout' . DS . 'error.ctp',
			'src' . DS . 'Controller' . DS . 'PagesController.php',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'default.ctp',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'error.ctp',
			'src' . DS . 'Template' . DS . 'Element' . DS . 'Flash' . DS . 'success.ctp',
		];
		$ret = 0;
		foreach ($files as $file) {
			$ret |= $this->_addFile($file, $sourcePath, $path);
{'fraction_non_alphanumeric': 0.1965128205128205, 'fraction_numerical': 0.005743589743589744, 'mean_word_length': 2.5669348939283103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '3928779', 'n_tokens_mistral': 1923, 'n_tokens_neox': 1710, 'n_words': 475}