<commit_before><?php
namespace Cannoli\Framework;

// These includes must happen here because the classes within the included
// files are required before the autoload configuration has been loaded.
require_once dirname(__FILE__) ."/core/exception/frameworkexception.class.php";
require_once dirname(__FILE__) ."/core/utility/configurablesingleton.class.php";
require_once dirname(__FILE__) ."/core/configuration/configurationmanager.class.php";
require_once dirname(__FILE__) ."/core/configuration/configurationcontainer.class.php";

require_once dirname(__FILE__) ."/router.class.php";

require_once dirname(__FILE__) ."/core/cache/appsettings.class.php";

use Cannoli\Framework\Core,
	Cannoli\Framework\Core\Configuration,
	Cannoli\Framework\Core\Exception,
	Cannoli\Framework\Core\Ioc,
	Cannoli\Framework\Core\Ioc\Modules,
	Cannoli\Framework\Core\Plugin,
	Cannoli\Framework\Core\Utility;

class Application extends Utility\ConfigurableSingleton
{	
	/* Instance member variables. */
	protected $session;
	
	protected $router;

	protected $iocContainer;
	
	private $al_directories = array();
	
	/**
	 * Protected constructor to avoid instantiation by anyone but itself. The
	 * constructor will initialize the framework right up to the point where
	 * the configuration is loaded.
	 * Other systems are initialized in the run method.
	 *
	 * @access protected
	 */
	protected function __construct() {
		parent::__construct();

		// First thing should always be to register the autoload function
		spl_autoload_register(array($this, "autoload"), false);

		// Next, we should add all the required autoload directories that
		// are needed for 'boot'
		$this->addSystemAutoloadPaths();

		// Initialize configuration manager and register this class as a configurable
		$cm =& $this->getConfigurationManager();
		$cm->registerConfigurable($this);

		// Then we need to check if all the prerequisites are in place
		$this->checkPrerequisites();

		// Load the framework configuration
		$this->loadConfiguration();
		
		$this->session = new Core\Session\SessionCache();
		$this->router = new Router($this);
		$this->router->setDefaultController($this->config("Cannoli.Framework.Controller", "defaultController", ""));
	}

	/**
	 * IConfigurable enforced method.
	 *
	 * Returns the array of configuration domains this class is interested
	 * in receiving configurations for.
	 *
	 * @access public
	 * @return array 			An array of domain strings
	 */<commit_msg>Small default controller update in application.class.php<commit_after><?php
namespace Cannoli\Framework;

// These includes must happen here because the classes within the included
// files are required before the autoload configuration has been loaded.
require_once dirname(__FILE__) ."/core/exception/frameworkexception.class.php";
require_once dirname(__FILE__) ."/core/utility/configurablesingleton.class.php";
require_once dirname(__FILE__) ."/core/configuration/configurationmanager.class.php";
require_once dirname(__FILE__) ."/core/configuration/configurationcontainer.class.php";

require_once dirname(__FILE__) ."/router.class.php";

require_once dirname(__FILE__) ."/core/cache/appsettings.class.php";

use Cannoli\Framework\Core,
	Cannoli\Framework\Core\Configuration,
	Cannoli\Framework\Core\Exception,
	Cannoli\Framework\Core\Ioc,
	Cannoli\Framework\Core\Ioc\Modules,
	Cannoli\Framework\Core\Plugin,
	Cannoli\Framework\Core\Utility;

class Application extends Utility\ConfigurableSingleton
{	
	/* Instance member variables. */
	protected $session;
	
	protected $router;

	protected $iocContainer;
	
	private $al_directories = array();
	
	/**
	 * Protected constructor to avoid instantiation by anyone but itself. The
	 * constructor will initialize the framework right up to the point where
	 * the configuration is loaded.
	 * Other systems are initialized in the run method.
	 *
	 * @access protected
	 */
	protected function __construct() {
		parent::__construct();

		// First thing should always be to register the autoload function
		spl_autoload_register(array($this, "autoload"), false);

		// Next, we should add all the required autoload directories that
		// are needed for 'boot'
		$this->addSystemAutoloadPaths();

		// Initialize configuration manager and register this class as a configurable
		$cm =& $this->getConfigurationManager();
		$cm->registerConfigurable($this);

		// Then we need to check if all the prerequisites are in place
		$this->checkPrerequisites();

		// Load the framework configuration
		$this->loadConfiguration();
		
		$this->session = new Core\Session\SessionCache();
		$this->router = new Router($this);
		$this->router->setDefaultController($this->config("Cannoli.Framework.Controller", "defaultController", ""));
		if ( ($defaultController = $this->config("Cannoli.Application.Controller", "defaultController", "")) != "" ) {
			$this->router->setDefaultController($defaultController);
		}
	}

	/**
	 * IConfigurable enforced method.
	 *
	 * Returns the array of configuration domains this class is interested
	 * in receiving configurations for.
	 *
	 * @access public
	 * @return array 			An array of domain strings
	 */
{'fraction_non_alphanumeric': 0.10899182561307902, 'fraction_numerical': 0.0, 'mean_word_length': 4.703662597114318, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '102000', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1381, 'n_words': 406}