<commit_before><?php
/**
 * @version		$Id$
 * @category	Koowa
 * @package		Koowa_Template
 * @copyright	Copyright (C) 2007 - 2009 <NAME> and <NAME>. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.koowa.org
 */

 /**
 * Default template stream wrapper
 * 
 * @author		<NAME> <<EMAIL>>
 * @category	Koowa
 * @package		Koowa_Template
 */
class KTemplate extends KTemplateAbstract
{
   /**
     * Register the stream wrapper 
     * 
     * Function prevents from registering the wrapper twice
     */
	public static function register()
	{	
		if (!in_array('tmpl', stream_get_wrappers())) 
		{
			ini_set('suhosin.executor.include.whitelist', ini_get('suhosin.executor.include.whitelist'). ', tmpl://');
			stream_wrapper_register('tmpl', __CLASS__);
		}
    } 
    
	/**
	 * Load a helper and pass the arguments
	 * 
	 * Additional arguments may be supplied and are passed to helper
	 *
	 * @param	string	Name of the helper, dot separated
	 * @param	mixed	Parameters to be passed to the helper
	 * @return 	string	Helper output
	 * @throws 	KTemplateException
	 */
	public static function loadHelper($identifier)
	{
		$base  = 'lib.koowa.template.helper';
		$file  = 'default';
		$func  = $identifier;
		
		// Check to see if we need to load a helper file
		$parts = explode('.', $identifier);
		
		switch(count($parts))
		{
			case 5 :
			{
				$base		= $parts[0].'.'.$parts[1].'.'.$parts[2];
				$file		= $parts[3];
				$func		= $parts[4];<commit_msg>Reverting previous commit, suhosin.executor.include.whitelist cannot be set via ini_set. Damn you !<commit_after><?php
/**
 * @version		$Id$
 * @category	Koowa
 * @package		Koowa_Template
 * @copyright	Copyright (C) 2007 - 2009 <NAME> and <NAME>. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.koowa.org
 */

 /**
 * Default template stream wrapper
 * 
 * @author		<NAME> <<EMAIL>>
 * @category	Koowa
 * @package		Koowa_Template
 */
class KTemplate extends KTemplateAbstract
{
   /**
     * Register the stream wrapper 
     * 
     * Function prevents from registering the wrapper twice
     */
	public static function register()
	{	
		if (!in_array('tmpl', stream_get_wrappers())) {
			stream_wrapper_register('tmpl', __CLASS__);
		}
    } 
    
	/**
	 * Load a helper and pass the arguments
	 * 
	 * Additional arguments may be supplied and are passed to helper
	 *
	 * @param	string	Name of the helper, dot separated
	 * @param	mixed	Parameters to be passed to the helper
	 * @return 	string	Helper output
	 * @throws 	KTemplateException
	 */
	public static function loadHelper($identifier)
	{
		$base  = 'lib.koowa.template.helper';
		$file  = 'default';
		$func  = $identifier;
		
		// Check to see if we need to load a helper file
		$parts = explode('.', $identifier);
		
		switch(count($parts))
		{
			case 5 :
			{
				$base		= $parts[0].'.'.$parts[1].'.'.$parts[2];
				$file		= $parts[3];
				$func		= $parts[4];
{'fraction_non_alphanumeric': 0.13832948167712117, 'fraction_numerical': 0.011224826675470452, 'mean_word_length': 3.0562248995983934, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4815703', 'n_tokens_mistral': 1119, 'n_tokens_neox': 994, 'n_words': 278}