<commit_before><?php
class load
{

	function __construct(&$controller) {
		$this->contr = &$controller;
	}
	
	function view($name)
	{
		global $fathr;
		if(file_exists($fathr->config['applicationpath'] . '/views/' . $name . '.php')) {
			include($fathr->config['applicationpath'] . '/views/' . $name . '.php');
		}
	}
	
	function model($name, $db = false)
	{
		global $fathr;
		if(file_exists($fathr->config['applicationpath'] . '/models/' . $name . '.php')) {
			include($fathr->config['applicationpath'] . '/models/' . $name . '.php');
			$modelname = ucfirst($name);
			if(!isset($this->contr->$name)) {
				$this->contr->$name = new $modelname($db);
			}
		}
	}
		
	function helper($name)
	{
		global $fathr;
		if(file_exists('system/helpers/' . $name . '.php')) {
			include('system/helpers/' . $name . '.php');
			if($name == "db")
			{
				$modelname = ucfirst($name);
				$fathr->db = new $modelname();
				$this->contr->$name = &$fathr->db;
			}
			else {
				$modelname = ucfirst($name);
				if(!isset($this->contr->$name)) {
					$this->contr->$name = new $modelname();
				}
			}
		}
	}
}
?><commit_msg>added load function for theme engine.<commit_after><?php
class load
{

	function __construct(&$controller) {
		$this->contr = &$controller;
	}
	
	function view($name)
	{
		global $fathr;
		if(file_exists($fathr->config['applicationpath'] . '/views/' . $name . '.php')) {
			include($fathr->config['applicationpath'] . '/views/' . $name . '.php');
		}
	}
	
	function model($name, $db = false)
	{
		global $fathr;
		if(file_exists($fathr->config['applicationpath'] . '/models/' . $name . '.php')) {
			include($fathr->config['applicationpath'] . '/models/' . $name . '.php');
			$modelname = ucfirst($name);
			if(!isset($this->contr->$name)) {
				$this->contr->$name = new $modelname($db);
			}
		}
	}
		
	function helper($name)
	{
		global $fathr;
		if(file_exists('system/helpers/' . $name . '.php')) {
			include('system/helpers/' . $name . '.php');
			if($name == "db")
			{
				$modelname = ucfirst($name);
				$fathr->db = new $modelname();
				$this->contr->$name = &$fathr->db;
			}
			else {
				$modelname = ucfirst($name);
				if(!isset($this->contr->$name)) {
					$this->contr->$name = new $modelname();
				}
			}
		}
	}
	
	function theme($theme = null)
	{
		global $fathr;
		if(!isset($fathr->theme)) {
			if($theme != null) {
				$father->theme = new Theme($theme);
			}
			else {
				$father->theme = new Theme();
			}
		}
		$this->contr->theme = &$father->theme;
	}
}
?>
{'fraction_non_alphanumeric': 0.2317219336795845, 'fraction_numerical': 0.0, 'mean_word_length': 3.0517799352750807, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '879263', 'n_tokens_mistral': 1083, 'n_tokens_neox': 929, 'n_words': 152}