<commit_before><?php

namespace Politix\PolitikportalBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class MainController extends Controller {
	
	var $response = FALSE;
	
	function __construct() {
		$this->response = new Response();
	  $this->response->setPublic();
 // $this->response->setMaxAge(60);
 // $this->response->setSharedMaxAge(60);
		$this->apc = function_exists('apc_fetch');	
	}
    
  public function getHomepageAction() {
		
		if (($this->apc) && (apc_fetch('homeLastModified'))) {
			$ApcLastModified = apc_fetch('homeLastModified');
		} else {
			$ApcLastModified = time();
			if ($this->apc) apc_store('homeLastModified',time());
		}
		$timezone = new \DateTimeZone('Europe/Brussels');
		$lastModified = new \DateTime('@' . $ApcLastModified);
    $lastModified->setTimezone($timezone);
    $this->response->setLastModified($lastModified);
    $request = $this->getRequest();
    if ($this->response->isNotModified($this->getRequest())) {
      return $this->response;
    }
    	
    $out['heading'] = $lastModified->format('r');
    
    $TopicModel = $this->get('TopicModel');
    $topics = $TopicModel->getHomepageTopics();	
    $out['topics'] = array();
    foreach ($topics as $topic) {
    	if ($items = $TopicModel->getTopic($topic)) {
    	  $out['topics']['topic'.$topic['id']]['items'] = $items;
    		$out['topics']['topic'.$topic['id']]['title'] = $topic['title_at'];
    	}
    }
    
    $sources = $this->get('SourceModel');
    $out['partners'][] = $sources->getSource('wkoe',0,1);
    $this->response->setContent($this->renderView('PolitikportalBundle:Default:topics.html.twig', $out));
    return $this->response;    
  }        
    
}
<commit_msg>Add custom IE response HTTP header<commit_after><?php

namespace Politix\PolitikportalBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class MainController extends Controller {
	
	var $response = FALSE;
	
	function __construct() {
		$this->response = new Response();
	  $this->response->setPublic();
 // $this->response->setMaxAge(60);
 // $this->response->setSharedMaxAge(60);
		$this->apc = function_exists('apc_fetch');
		
		$response = $this->getResponse();
		$response->setHttpHeader('X-UA-Compatible', 'IE=edge,chrome=1');

	}
    
  public function getHomepageAction() {
		
		if (($this->apc) && (apc_fetch('homeLastModified'))) {
			$ApcLastModified = apc_fetch('homeLastModified');
		} else {
			$ApcLastModified = time();
			if ($this->apc) apc_store('homeLastModified',time());
		}
		$timezone = new \DateTimeZone('Europe/Brussels');
		$lastModified = new \DateTime('@' . $ApcLastModified);
    $lastModified->setTimezone($timezone);
    $this->response->setLastModified($lastModified);
    $request = $this->getRequest();
    if ($this->response->isNotModified($this->getRequest())) {
      return $this->response;
    }
    	
    $out['heading'] = $lastModified->format('r');
    
    $TopicModel = $this->get('TopicModel');
    $topics = $TopicModel->getHomepageTopics();	
    $out['topics'] = array();
    foreach ($topics as $topic) {
    	if ($items = $TopicModel->getTopic($topic)) {
    	  $out['topics']['topic'.$topic['id']]['items'] = $items;
    		$out['topics']['topic'.$topic['id']]['title'] = $topic['title_at'];
    	}
    }
    
    $sources = $this->get('SourceModel');
    $out['partners'][] = $sources->getSource('wkoe',0,1);
    $this->response->setContent($this->renderView('PolitikportalBundle:Default:topics.html.twig', $out));
    return $this->response;    
  }        
    
}

{'fraction_non_alphanumeric': 0.19370725034199726, 'fraction_numerical': 0.0035567715458276333, 'mean_word_length': 4.2079772079772075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '1216783', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1188, 'n_words': 169}