<commit_before><?php

	require_once(TOOLKIT . '/class.devkit.php');
	
	class Content_ProfileDevKit extends DevKit {
		protected $_view = '';
		protected $_xsl = '';
		protected $_profiler = null;
		protected $_records = array();
		protected $_dbstats = array();
		
		public function __construct(){
			parent::__construct();
			
			$this->_title = __('Profile');
			$this->_query_string = parent::__buildQueryString(array('symphony-page', 'profile'));
			
			if (!empty($this->_query_string)) {
				$this->_query_string = '&amp;' . General::sanitize($this->_query_string);
			}
		}
		
		public function build() {
			$this->_view = (strlen(trim($_GET['profile'])) == 0 ? 'general' : $_GET['profile']);
			$this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
			
			// Build statistics:
			$this->_profiler = $this->_page->_Parent->Profiler;
			$this->_dbstats = $this->_page->_Parent->Database->getStatistics();
			$this->_records = array(
				'general'			=> $this->_profiler->retrieveGroup('General'),
				'data-sources'		=> $this->_profiler->retrieveGroup('Datasource'),
				'events'			=> $this->_profiler->retrieveGroup('Event'),
				'slow-queries'		=> array()
			);
			
			if (is_array($this->_dbstats['slow-queries']) && !empty($this->_dbstats['slow-queries'])) {
				foreach ($this->_dbstats['slow-queries'] as $q) {
					$this->_records['slow-queries'][] = array($q['time'], $q['query'], null, null, false);
				}<commit_msg>Using Frontend::instance()->Profiler and Symphony::Database() instead of old $this->_Parent->xxx method.<commit_after><?php

	require_once(TOOLKIT . '/class.devkit.php');
	
	class Content_ProfileDevKit extends DevKit {
		protected $_view = '';
		protected $_xsl = '';
		protected $_profiler = null;
		protected $_records = array();
		protected $_dbstats = array();
		
		public function __construct(){
			parent::__construct();
			
			$this->_title = __('Profile');
			$this->_query_string = parent::__buildQueryString(array('symphony-page', 'profile'));
			
			if (!empty($this->_query_string)) {
				$this->_query_string = '&amp;' . General::sanitize($this->_query_string);
			}
		}
		
		public function build() {
			$this->_view = (strlen(trim($_GET['profile'])) == 0 ? 'general' : $_GET['profile']);
			$this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
			
			// Build statistics:
			$this->_profiler = Frontend::instance()->Profiler;
			$this->_dbstats = Symphony::Database()->getStatistics();
			$this->_records = array(
				'general'			=> $this->_profiler->retrieveGroup('General'),
				'data-sources'		=> $this->_profiler->retrieveGroup('Datasource'),
				'events'			=> $this->_profiler->retrieveGroup('Event'),
				'slow-queries'		=> array()
			);
			
			if (is_array($this->_dbstats['slow-queries']) && !empty($this->_dbstats['slow-queries'])) {
				foreach ($this->_dbstats['slow-queries'] as $q) {
					$this->_records['slow-queries'][] = array($q['time'], $q['query'], null, null, false);
				}
{'fraction_non_alphanumeric': 0.20613001010441226, 'fraction_numerical': 0.0006736274840013472, 'mean_word_length': 4.4, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 65, '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': '4303222', 'n_tokens_mistral': 1112, 'n_tokens_neox': 945, 'n_words': 154}