<commit_before><?php
namespace codebite\homebooru\Controller;
use \codebite\homebooru\Model\BooruPostModel;
use \emberlabs\shot\Controller\ObjectController;
use \R;

if(!defined('SHOT_ROOT')) exit;

class PostViewController
	extends ObjectController
{
	public function runController()
	{
		$id = $this->request->getRoute()->get('id');

		$bean = R::findOne('post', '(status = ? AND id = ?)', array(BooruPostModel::ENTRY_ACCEPT, $id));

		//$tag = R::findOne('tag', 'title = ?', array('shakugan_no_shana'));
		//$tag->type = \codebite\homebooru\Model\BooruTagModel::TAG_PLANE;
		//R::store($tag);
		//R::addTags($bean, 'shakugan_no_shana');

		if(empty($bean))
		{
			$this->response->setResponseCode(404);
			$this->response->setBody('error.twig.html');
			$this->response->setTemplateVars(array(
				'error'	=> array(
					'message'		=> 'Not found',
					'code'			=> 404,
				),
			));

			return $this->response;
		}

		$this->app->form->setFormSeed($this->app->session->getSessionSeed());
		$this->response->setBody('viewsingle.twig.html');
		$this->response->setTemplateVars(array(
			'page'				=> array(
				'single'			=> true,
			),
			'post'				=> $bean,
		));

		return $this->response;
	}
}
<commit_msg>erm, rm this accidentally committed stuff<commit_after><?php
namespace codebite\homebooru\Controller;
use \codebite\homebooru\Model\BooruPostModel;
use \emberlabs\shot\Controller\ObjectController;
use \R;

if(!defined('SHOT_ROOT')) exit;

class PostViewController
	extends ObjectController
{
	public function runController()
	{
		$id = $this->request->getRoute()->get('id');

		$bean = R::findOne('post', '(status = ? AND id = ?)', array(BooruPostModel::ENTRY_ACCEPT, $id));

		if(empty($bean))
		{
			$this->response->setResponseCode(404);
			$this->response->setBody('error.twig.html');
			$this->response->setTemplateVars(array(
				'error'	=> array(
					'message'		=> 'Not found',
					'code'			=> 404,
				),
			));

			return $this->response;
		}

		$this->app->form->setFormSeed($this->app->session->getSessionSeed());
		$this->response->setBody('viewsingle.twig.html');
		$this->response->setTemplateVars(array(
			'page'				=> array(
				'single'			=> true,
			),
			'post'				=> $bean,
		));

		return $this->response;
	}
}

{'fraction_non_alphanumeric': 0.20026702269692923, 'fraction_numerical': 0.0053404539385847796, 'mean_word_length': 4.167816091954023, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 58, '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': '3225647', 'n_tokens_mistral': 946, 'n_tokens_neox': 825, 'n_words': 116}