<commit_before><?php
/*
 * Copyright 2010 <NAME> <<EMAIL> at g<EMAIL> dot com>
 *
 * This file is part of CoOrg.
 *
 * CoOrg is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

  * CoOrg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Affero General Public License for more details.

  * You should have received a copy of the GNU Affero General Public License
  * along with CoOrg.  If not, see <http://www.gnu.org/licenses/>.
*/

abstract class ControllerBase
{
	abstract protected function notice($msg);
	abstract protected function error($msg);
	abstract protected function render($tpl, $app = false, $baseFile = 'base');
	abstract protected function mail();
	
	abstract public function __set($name, $value);
}

class Controller extends ControllerBase
{

	private $_smarty = null;
	private $_renderType = 'html';
	private $_tplPath;
	private $_appPath;
	private $_contentTypes;
	
	public function init($path, $appPath = 'app/', $renderType = 'html')
	{
		$this->_tplPath = $path;
		$this->_appPath = $appPath;
		$this->_renderType = $renderType;
		$this->_contentTypes = array('atom' => 'application/xml+atom');
	}
	
	public function isPost($name)
	{
		if (in_array($name, array('update', 'save', 'delete'))) return true;
		$reflectionClass = new ReflectionClass($this);
		$reflectionMethod = $reflectionClass->getMethod($name);
		
		$comment = $reflectionMethod->getDocComment();
		
		$lines = explode("\n", $comment);<commit_msg>Another stupid ATOM bug<commit_after><?php
/*
 * Copyright 2010 <NAME> <<EMAIL> at gmail dot com>
 *
 * This file is part of CoOrg.
 *
 * CoOrg is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

  * CoOrg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Affero General Public License for more details.

  * You should have received a copy of the GNU Affero General Public License
  * along with CoOrg.  If not, see <http://www.gnu.org/licenses/>.
*/

abstract class ControllerBase
{
	abstract protected function notice($msg);
	abstract protected function error($msg);
	abstract protected function render($tpl, $app = false, $baseFile = 'base');
	abstract protected function mail();
	
	abstract public function __set($name, $value);
}

class Controller extends ControllerBase
{

	private $_smarty = null;
	private $_renderType = 'html';
	private $_tplPath;
	private $_appPath;
	private $_contentTypes;
	
	public function init($path, $appPath = 'app/', $renderType = 'html')
	{
		$this->_tplPath = $path;
		$this->_appPath = $appPath;
		$this->_renderType = $renderType;
		$this->_contentTypes = array('atom' => 'application/atom+xml');
	}
	
	public function isPost($name)
	{
		if (in_array($name, array('update', 'save', 'delete'))) return true;
		$reflectionClass = new ReflectionClass($this);
		$reflectionMethod = $reflectionClass->getMethod($name);
		
		$comment = $reflectionMethod->getDocComment();
		
		$lines = explode("\n", $comment);
{'fraction_non_alphanumeric': 0.11439842209072978, 'fraction_numerical': 0.002817695125387433, 'mean_word_length': 4.411585365853658, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '2235800', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1007, 'n_words': 390}