<commit_before><?php

namespace assegai;

/**
 * Request dispatcher.
 *
 * This is the main class of Assegai and a routing wrapper around
 * Atlatl. The principle is simple; the request is routed to the
 * correct Atlatl appliction, then the output is processed by the
 * global settings.
 *
 * This file is part of Assegai
 *
 * Assegai is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * Assegai is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Assegai.  If not, see <http://www.gnu.org/licenses/>.
 */
class Dispatcher extends \atlatl\Core
{
    protected $root_path;
	protected $apps_path;
    protected $models_path;
    protected $exceptions_path;
    protected $modules_path;
    protected $custom_modules_path;
	protected $apps;

    protected $main_conf;
	protected $apps_conf;

	protected $current_app;
	protected $prefix;

	protected $apps_routes;
	protected $routes;

    function __construct($conf = false)
    {
        parent::__construct('', new Server($_SERVER));
        $this->root_path = dirname(__DIR__);
        $this->conf_path = ($conf? $conf : $this->getPath('conf.php'));
        $this->parseconf();
    }

    /**
     * Parses the global configuration file and that of each
     * application.
     */
    protected function parseconf()
    {
		// Loading the main configuration file first so we can get the paths.
		$conf = array(
			'prefix' => '',
			'apps_path' => 'apps',
            'models_path' => 'models',
            'helpers_path' => 'helpers',
            'exceptions_path' => 'exceptions',
            'modules_path' => 'lib/modules',
			'apps' => array(),
            'modules' => array(),
			);

        if(file_exists($this->conf_path)) {
            require($this->conf_path);<commit_msg>Fixed incorrect use of atlatl's request object.<commit_after><?php

namespace assegai;

/**
 * Request dispatcher.
 *
 * This is the main class of Assegai and a routing wrapper around
 * Atlatl. The principle is simple; the request is routed to the
 * correct Atlatl appliction, then the output is processed by the
 * global settings.
 *
 * This file is part of Assegai
 *
 * Assegai is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * Assegai is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Assegai.  If not, see <http://www.gnu.org/licenses/>.
 */
class Dispatcher extends \atlatl\Core
{
    protected $root_path;
	protected $apps_path;
    protected $models_path;
    protected $exceptions_path;
    protected $modules_path;
    protected $custom_modules_path;
	protected $apps;

    protected $main_conf;
	protected $apps_conf;

	protected $current_app;
	protected $prefix;

	protected $apps_routes;
	protected $routes;

    function __construct($conf = false)
    {
        parent::__construct('', new Server($_SERVER), new Request($_GET, $_POST, new \atlatl\Security(), array(), array()));
        $this->root_path = dirname(__DIR__);
        $this->conf_path = ($conf? $conf : $this->getPath('conf.php'));
        $this->parseconf();
    }

    /**
     * Parses the global configuration file and that of each
     * application.
     */
    protected function parseconf()
    {
		// Loading the main configuration file first so we can get the paths.
		$conf = array(
			'prefix' => '',
			'apps_path' => 'apps',
            'models_path' => 'models',
            'helpers_path' => 'helpers',
            'exceptions_path' => 'exceptions',
            'modules_path' => 'lib/modules',
			'apps' => array(),
            'modules' => array(),
			);

        if(file_exists($this->conf_path)) {
            require($this->conf_path);
{'fraction_non_alphanumeric': 0.10558035714285714, 'fraction_numerical': 0.0004464285714285714, 'mean_word_length': 3.1072410632447296, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3173075', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1249, 'n_words': 470}