<commit_before><?php
/**
 * @author      <NAME> <<EMAIL>>
 * @copyright   Copyright (c), 2016 <NAME>
 * @license     MIT public license
 */

namespace App;

use \Bramus\Router\Router as Router;
use \App\DB\Database as Database;

/**
 * Class App
 */
class Application
{
	/**
     * @var bool
     */
	private $debug;

	/**
     * @var instance
     */
	private $router;

	/**
     * @var instance
     */
	private $db;

	/**
     * @var instance
     */
	private $twigLoader;

	/**
     * @var instance
     */
	private $twig;

    /**
     * public variables
     */
	public $webroot;
    public $domain;
	public $app;
	public $config_path;
	public $resources;
	public $controllers;
	public $models;
	public $views;
	public $src;
	public $config;

	/**
     * Constructor
     */
	public function __construct (bool $debug = false)
	{
		$this->debug = $debug;
        
        if ($this->debug):
            ini_set('display_errors', 1);
			ini_set('display_startup_errors', 1);
			error_reporting(E_ALL);
		else:
			ini_set('display_errors', 0);
			ini_set('display_startup_errors', 0);
			error_reporting(E_ALL);
        endif;
		
        $this->webroot = str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']);
		$this->app = $this->webroot.'app/';
		$this->config_path = $this->webroot.'app/config';
		$this->resources = $this->webroot.'app/Resources/';
		$this->models = $this->resources.'models/';
		$this->views = $this->resources.'views/';
		$this->src = $this->webroot.'src/';
        $this->config = parse_ini_file($this->config_path.'/config.ini', true);
		$this->domain = $this->config['framework']['path'];

		$this->router = new Router();

		$this->db = new Database($this->config['dbDns']['host'], $this->config['dbDns']['dbname'], $this->config['dbDns']['user'], $this->config['dbDns']['pass']);
        
        $this->private_key = $this->config['framework']['private_key'];

		\Twig_Autoloader::register();
		$this->twigLoader = new \Twig_Loader_Filesystem($this->views);
		$this->twig = new \Twig_Environment($this->twigLoader, array('debug' => $this->debug));
	}

	private function __clone () {}
<commit_msg>Adding few comments to system.php<commit_after><?php
/**
 * @author      <NAME> <<EMAIL>>
 * @copyright   Copyright (c), 2016 <NAME>
 * @license     MIT public license
 */

namespace App;

use \Bramus\Router\Router as Router;
use \App\DB\Database as Database;

/**
 * Class App
 */
class Application
{
	/**
     * @var bool
     */
	private $debug;

	/**
     * @var instance
     */
	private $router;

	/**
     * @var instance
     */
	private $db;

	/**
     * @var instance
     */
	private $twigLoader;

	/**
     * @var instance
     */
	private $twig;

    /**
     * public variables
     */
	public $webroot;
    public $domain;
	public $app;
	public $config_path;
	public $resources;
	public $controllers;
	public $models;
	public $views;
	public $src;
	public $config;

	/**
     * Constructor
     */
	public function __construct (bool $debug = false)
	{
        // Initializing debug value
		$this->debug = $debug;
        
        // Enabling up PHP errors in development env
        if ($this->debug):
            ini_set('display_errors', 1);
			ini_set('display_startup_errors', 1);
			error_reporting(E_ALL);
		else:
			ini_set('display_errors', 0);
			ini_set('display_startup_errors', 0);
			error_reporting(E_ALL);
        endif;
		
        // Router instance
        $this->webroot = str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']);
		$this->app = $this->webroot.'app/';
		$this->config_path = $this->webroot.'app/config';
		$this->resources = $this->webroot.'app/Resources/';
		$this->models = $this->resources.'models/';
		$this->views = $this->resources.'views/';
		$this->src = $this->webroot.'src/';
        $this->config = parse_ini_file($this->config_path.'/config.ini', true);
		$this->domain = $this->config['framework']['path'];
        
        // Setting up application private key
        // Private key is a sha256 string which allows you to hash passwords in a secure way
        $this->private_key = $this->config['framework']['private_key'];

        // Router instance
		$this->router = new Router();

        // Database instance
		$this->db = new Database($this->config['dbDns']['host'], $this->config['dbDns']['dbname'], $this->config['dbDns']['user'], $this->config['dbDns']['pass']);
        
        // TwigLoader and Twig instances
		\Twig_Autoloader::register();
		$this->twigLoader = new \Twig_Loader_Filesystem($this->views);
		$this->twig = new \Twig_Environment($this->twigLoader, array('debug' => $this->debug));
	}

	private function __clone () {}

{'fraction_non_alphanumeric': 0.18152454780361757, 'fraction_numerical': 0.00409130060292851, 'mean_word_length': 2.9871244635193133, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 77, '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': '1300616', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1527, 'n_words': 315}