<commit_before><?php

namespace light;

use light\Http\Request;
use light\Console\Input;
use light\Console\Output;

/**
 * Light App
 *
 * @package light
 */
class App extends Container
{
	const VERSION = '1.2.0';

	/**
	 * 应用名称
	 *
	 * @var string
	 */
	protected $name;

	/**
	 * 根目录
	 *
	 * @var string
	 */
	public $basePath;

	/**
	 * 系统运行环境
	 *
	 * @var string
	 */
	protected $environment;

	/**
	 * 应用配置
	 *
	 * @var array
	 */
	protected $config = [];

	/**
	 * App constructor.
	 *
	 */
	public function __construct()
	{
		mb_internal_encoding('UTF-8');
		date_default_timezone_set('Asia/Shanghai');

		// 记录程序运行环境
        // todo 通过其他方式指定 basePath 和 environment
		$this->basePath = __ROOT__;
		$this->environment = __ENV__;

		$this->name = $this->configGet('app.name', 'light');
	}

	/**
	 * 启动应用
	 *
	 * @return $this
	 */
	public function bootstrap()
	{<commit_msg>初始化 App 时候, path 和 environment 需要明确的以传参方式传入<commit_after><?php

namespace light;

use light\Http\Request;
use light\Console\Input;
use light\Console\Output;

/**
 * Light App
 *
 * @package light
 */
class App extends Container
{
	const VERSION = '1.2.0';

	/**
	 * 应用名称
	 *
	 * @var string
	 */
	protected $name;

	/**
	 * 根目录
	 *
	 * @var string
	 */
	public $basePath;

	/**
	 * 系统运行环境
	 *
	 * @var string
	 */
	protected $environment;

	/**
	 * 应用配置
	 *
	 * @var array
	 */
	protected $config = [];

    /**
     * App constructor.
     *
     * @param $path
     * @param $environment
     */
	public function __construct($path, $environment)
	{
		mb_internal_encoding('UTF-8');
		date_default_timezone_set('Asia/Shanghai');

		// 记录程序运行环境
		$this->basePath = $path;
		$this->environment = $environment;

		$this->name = $this->configGet('app.name', 'light');

		return $this;
	}

	/**
	 * 启动应用
	 *
	 * @return $this
	 */
	public function bootstrap()
	{
{'fraction_non_alphanumeric': 0.16439847577572128, 'fraction_numerical': 0.004354926510615134, 'mean_word_length': 2.611001964636542, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3566130', 'n_tokens_mistral': 778, 'n_tokens_neox': 733, 'n_words': 140}