<commit_before><?php

	require_once(CORE . '/class.symphony.php');
	require_once(TOOLKIT . '/class.xmldoc.php');	
	require_once(TOOLKIT . '/class.lang.php');
	require_once(TOOLKIT . '/class.manager.php');	
	require_once(TOOLKIT . '/class.frontendpage.php');
		
	Class Frontend extends Symphony{
		
		public $displayProfilerReport;
		
		public static function instance(){
			if(!(self::$_instance instanceof Administration)) 
				self::$_instance = new self;
				
			return self::$_instance;
		}
				
		protected function __construct(){
			parent::__construct();
			
			$this->Profiler->sample('Engine Initialisation');

			$this->_env = array();
		}

		public function isLoggedIn(){
			if($_REQUEST['auth-token'] && strlen($_REQUEST['auth-token']) == 8) return $this->loginFromToken($_REQUEST['auth-token']);
			
			return parent::isLoggedIn();
		}
		
		public function display($page){
			
			$mode = FrontendPage::FRONTEND_OUTPUT_NORMAL;
			
			if($this->isLoggedIn()){
				if(isset($_GET['debug'])) $mode = FrontendPage::FRONTEND_OUTPUT_DEBUG;
				elseif(isset($_GET['profile'])) $mode = FrontendPage::FRONTEND_OUTPUT_PROFILE;
			}
			
			$oPage =& new FrontendPage($this);

			$output = $oPage->generate($page, $mode);

			return $output;

		}
		
	}
<commit_msg>Issue #135<commit_after><?php

	require_once(CORE . '/class.symphony.php');
	require_once(TOOLKIT . '/class.xmldoc.php');	
	require_once(TOOLKIT . '/class.lang.php');
	require_once(TOOLKIT . '/class.manager.php');	
	require_once(TOOLKIT . '/class.frontendpage.php');
		
	Class Frontend extends Symphony{
		
		public $displayProfilerReport;
		
		public static function instance(){
			if(!(self::$_instance instanceof Frontend)) 
				self::$_instance = new self;
				
			return self::$_instance;
		}
				
		protected function __construct(){
			parent::__construct();
			
			$this->Profiler->sample('Engine Initialisation');

			$this->_env = array();
		}

		public function isLoggedIn(){
			if($_REQUEST['auth-token'] && strlen($_REQUEST['auth-token']) == 8) return $this->loginFromToken($_REQUEST['auth-token']);
			
			return parent::isLoggedIn();
		}
		
		public function display($page){
			
			$mode = FrontendPage::FRONTEND_OUTPUT_NORMAL;
			
			if($this->isLoggedIn()){
				if(isset($_GET['debug'])) $mode = FrontendPage::FRONTEND_OUTPUT_DEBUG;
				elseif(isset($_GET['profile'])) $mode = FrontendPage::FRONTEND_OUTPUT_PROFILE;
			}
			
			$oPage =& new FrontendPage($this);

			$output = $oPage->generate($page, $mode);

			return $output;

		}
		
	}

{'fraction_non_alphanumeric': 0.16620388734629116, 'fraction_numerical': 0.0019833399444664813, 'mean_word_length': 4.105263157894737, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6943462', 'n_tokens_mistral': 989, 'n_tokens_neox': 809, 'n_words': 135}