<commit_before><?php
class News extends CI_Controller {

        public function __construct()
        {
                parent::__construct();
                $this->load->model('news_model');
                $this->load->helper('url_helper');
        }

		public function index()
		{
				
		        $data['news'] = $this->news_model->get_news();
		        $data['title'] = 'Index';
		
		        $this->load->view('templates/header', $data);
		        $this->load->view('news/index', $data);
		        $this->load->view('templates/footer');
		}

		public function view($slug = NULL)
		{
				
		        $data['news_item'] = $this->news_model->get_news($slug);
		
		        if (empty($data['news_item']))
		        {		
		        		echo "News/view/$slug";
		        		die();
		        		
		                show_404();
		        }
		
		        $data['title'] = $data['news_item']['title'];
		
		        $this->load->view('templates/header', $data);
		        $this->load->view('news/view', $data);
		        $this->load->view('templates/footer');
		}
		
		public function create()
		{
			
			$this->load->helper('form');
			$this->load->library('form_validation');
		
			$data['title'] = 'Create';
		
			$this->form_validation->set_rules('title', 'Title', 'required');
			$this->form_validation->set_rules('text', 'Text', 'required');

			if ($this->form_validation->run() === FALSE)
			{
				$this->load->view('templates/header', $data);
				$this->load->view('news/create');
				$this->load->view('templates/footer');
		
			}
			else
			{
				$this->news_model->set_news();
				$this->load->view('news/success');
			}
		}
		
}<commit_msg>News.php<commit_after><?php
class News extends CI_Controller {

        public function __construct()
        {
                parent::__construct();
                $this->load->model('news_model');
                $this->load->helper('url_helper');
        }

		public function index()
		{
				
		        $data['news'] = $this->news_model->get_news();
		        $data['title'] = 'Index';
		
		        $this->load->view('templates/header', $data);
		        $this->load->view('news/index', $data);
		        $this->load->view('templates/footer');
		}

		public function view($slug = NULL)
		{
				
		        $data['news_item'] = $this->news_model->get_news($slug);
		
		        if (empty($data['news_item']))
		        {		
		        		echo "News/view/$slug";
		        		die();
		        		
		                show_404();
		        }
		
		        $data['title'] = $data['news_item']['title'];
		
		        $this->load->view('templates/header', $data);
		        $this->load->view('news/view', $data);
		        $this->load->view('templates/footer');
		}
		
		public function create()
		{
			echo "create";
			echo "<br>";
			
			$this->load->helper('form');
			$this->load->library('form_validation');
		
			$data['title'] = 'Create';
		
			$this->form_validation->set_rules('title', 'Title', 'required');
			$this->form_validation->set_rules('text', 'Text', 'required');

			if ($this->form_validation->run() === FALSE)
			{
				echo "false";
				echo "<br>";
				
				$this->load->view('templates/header', $data);
				$this->load->view('news/create');
				$this->load->view('templates/footer');
		
			}
			else
			{
				echo "true";
				echo "<br>";
				$this->news_model->set_news();
				$this->load->view('news/success');
			}
		}
		
}
{'fraction_non_alphanumeric': 0.204027243115191, 'fraction_numerical': 0.0017767249037607344, 'mean_word_length': 2.159962581852198, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 86, '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': '5809134', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1040, 'n_words': 142}