<commit_before><?php

/**
 * Frontend page class, this class will handle everything on a page
 *
 * @package		frontend
 * @subpackage	core
 *
 * @author		<NAME> <<EMAIL>>
 * @since		2.0
 */
class FrontendPage extends FrontendBaseObject
{
	/**
	 * Breadcrumb instance
	 *
	 * @var	FrontendBreadcrumb
	 */
	private $breadcrumb;


	/**
	 * Current page id
	 *
	 * @var	int
	 */
	private static $currentPageId;


	/**
	 * Footer instance
	 *
	 * @var	FrontendFooter
	 */
	private $footer;


	/**
	 * Header instance
	 *
	 * @var	FrontendHeader
	 */
	private $header;


	/**
	 * The current pageId
	 *
	 * @var	int
	 */
	private $pageId;


	/**
	 * Content of the page
	 *
	 * @var	array
	 */
	private $record = array();


	/**
	 * The path of the template to show
	 *
	 * @var	string
	 */
	private $templatePath;


	/**
	 * The statuscode
	 *
	 * @var	int
	 */
	private $statusCode = 200;


	/**
	 * Default constructor
	 *
	 * @return	void
	 */
	public function __construct()
	{
		// call parent
		parent::__construct();

		// get pageId for requested URL
		$this->pageId = FrontendNavigation::getPageId(implode('/', $this->URL->getPages()));

		// make the pageId accessible through a static method
		self::$currentPageId = $this->pageId;

		// set headers if this is a 404 page
		if($this->pageId == 404) $this->statusCode = 404;

		// create header instance
		$this->header = new FrontendHeader();

		// get pagecontent
		$this->getPageContent();

		// process page
		$this->processPage();

		// store statistics
		$this->storeStatistics();

		// display
		$this->display();
	}


	/**
	 * Display the page
	 *
	 * @return	void
	 */
	public function display()
	{
		// parse header
		$this->header->parse();

		// parse breadcrumb
		$this->breadcrumb->parse();

		// parse languages
		$this->parseLanguages();

		// parse footer
		$this->footer->parse();

		// assign the id so we can use it as an option
		$this->tpl->assign('page' . $this->pageId, true);

		// fetch variables from main template
		$mainVariables = $this->tpl->getAssignedVariables();

		// loop all positions
		foreach($this->record['positions'] as $position => &$blocks)
		{
			// loop all blocks in this position<commit_msg>Page variabel renamed to better match the usage.<commit_after><?php

/**
 * Frontend page class, this class will handle everything on a page
 *
 * @package		frontend
 * @subpackage	core
 *
 * @author		<NAME> <<EMAIL>>
 * @since		2.0
 */
class FrontendPage extends FrontendBaseObject
{
	/**
	 * Breadcrumb instance
	 *
	 * @var	FrontendBreadcrumb
	 */
	private $breadcrumb;


	/**
	 * Current page id
	 *
	 * @var	int
	 */
	private static $currentPageId;


	/**
	 * Footer instance
	 *
	 * @var	FrontendFooter
	 */
	private $footer;


	/**
	 * Header instance
	 *
	 * @var	FrontendHeader
	 */
	private $header;


	/**
	 * The current pageId
	 *
	 * @var	int
	 */
	private $pageId;


	/**
	 * Content of the page
	 *
	 * @var	array
	 */
	private $record = array();


	/**
	 * The path of the template to show
	 *
	 * @var	string
	 */
	private $templatePath;


	/**
	 * The statuscode
	 *
	 * @var	int
	 */
	private $statusCode = 200;


	/**
	 * Default constructor
	 *
	 * @return	void
	 */
	public function __construct()
	{
		// call parent
		parent::__construct();

		// get pageId for requested URL
		$this->pageId = FrontendNavigation::getPageId(implode('/', $this->URL->getPages()));

		// make the pageId accessible through a static method
		self::$currentPageId = $this->pageId;

		// set headers if this is a 404 page
		if($this->pageId == 404) $this->statusCode = 404;

		// create header instance
		$this->header = new FrontendHeader();

		// get pagecontent
		$this->getPageContent();

		// process page
		$this->processPage();

		// store statistics
		$this->storeStatistics();

		// display
		$this->display();
	}


	/**
	 * Display the page
	 *
	 * @return	void
	 */
	public function display()
	{
		// parse header
		$this->header->parse();

		// parse breadcrumb
		$this->breadcrumb->parse();

		// parse languages
		$this->parseLanguages();

		// parse footer
		$this->footer->parse();

		// assign the id so we can use it as an option
		$this->tpl->assign('isPage' . $this->pageId, true);

		// fetch variables from main template
		$mainVariables = $this->tpl->getAssignedVariables();

		// loop all positions
		foreach($this->record['positions'] as $position => &$blocks)
		{
			// loop all blocks in this position
{'fraction_non_alphanumeric': 0.1489938955460095, 'fraction_numerical': 0.006330544879041375, 'mean_word_length': 2.7523324851569124, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 59, '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': '5298371', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1391, 'n_words': 398}