<commit_before><?php
/**
 * @author			<NAME> <<EMAIL>>
 * @copyright		BraDyUS. Communicating Cultural Heritage, http://bradypus.net 2007-2013
 * @license			MIT, See LICENSE file
 * @since			Feb 1, 2013
 */
 
class template_ctrl extends Controller
{
	
	public function compile()
	{
		try
		{
			$less = new lessc();
			$less->checkedCompile(SITE_DIR .  "css/styles.less", SITE_DIR . "css/styles.css");
			
			$ret['status'] = 'success';
			$ret['text'] = tr::get('ok_compiling_less');
		}
		catch (Exception $e)
		{
			$ret['status'] = 'error';
			$ret['text'] = tr::get('error_compiling_less');
		}
		
		echo json_encode($ret);
	}
	
	public function edit()
	{
		$file = $this->get['param'][0];
		$type = $this->get['param'][1];
		
		switch ($type)
		{
			case 'twig':
				$file = SITE_DIR . $file;
				break;<commit_msg>Added debug information logging in less compiling process<commit_after><?php
/**
 * @author			<NAME> <<EMAIL>>
 * @copyright		BraDyUS. Communicating Cultural Heritage, http://bradypus.net 2007-2013
 * @license			MIT, See LICENSE file
 * @since			Feb 1, 2013
 */
 
class template_ctrl extends Controller
{
	
	public function compile()
	{
		try
		{
			$less = new lessc();
			$less->checkedCompile(SITE_DIR .  "css/styles.less", SITE_DIR . "css/styles.css");
			
			$ret['status'] = 'success';
			$ret['text'] = tr::get('ok_compiling_less');
		}
		catch (Exception $e)
		{
      error_log($e->getTraceAsString());
			$ret['status'] = 'error';
			$ret['text'] = tr::get('error_compiling_less');
		}
		
		echo json_encode($ret);
	}
	
	public function edit()
	{
		$file = $this->get['param'][0];
		$type = $this->get['param'][1];
		
		switch ($type)
		{
			case 'twig':
				$file = SITE_DIR . $file;
				break;
{'fraction_non_alphanumeric': 0.18434782608695652, 'fraction_numerical': 0.017391304347826087, 'mean_word_length': 3.3585858585858586, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, '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': '2108897', 'n_tokens_mistral': 750, 'n_tokens_neox': 627, 'n_words': 133}