<commit_before><?php
/**
 *
 * @package     openflame-framework
 * @subpackage  twig
 * @copyright   (c) 2010 - 2011 openflame-project.org
 * @license     http://opensource.org/licenses/mit-license.php The MIT License
 * @link        https://github.com/OpenFlame/OpenFlame-Framework
 *
 * Minimum Requirement: PHP 5.3.0
 */

namespace OpenFlame\Framework\Twig;
use OpenFlame\Framework\Core;

/**
 * OpenFlame Framework - Twig management class
 * 	     Basically sets up Twig for use by the OpenFlame Framework.
 *
 *
 * @license     http://opensource.org/licenses/mit-license.php The MIT License
 * @link        https://github.com/OpenFlame/OpenFlame-Framework
 */
class Wrapper
{
	/**
	 * @var string - The path to the root directory of twig's include files.
	 */
	protected $twig_root_path = '';

	/**
	 * @var string - The path to the cache directory that we want to use for Twig.
	 */
	protected $twig_cache_path = '';

	/**
	 * @var array - The array of template paths to load from.
	 */
	protected $template_paths = array();

	/**
	 * @var array - The options to set when instantiating the twig environment object
	 */
	protected $twig_environment_options = array();

	/**
	 * @var \Twig_Loader_Filesystem - The twig filesystem loader object.
	 */
	protected $twig_loader;

	/**
	 * @var \Twig_Loader_Chain - The twig chain loader object.
	 */
	protected $twig_chain_loader;

	/**
	 * @var array - Array of additional twig loaders to use (Twig_Loader_Filesystem will always come first)
	 */
	protected $extra_twig_loaders = array();

	/**
	 * @var \Twig_Environment - The twig environment object.
	 */
	protected $twig_environment;

	/**
	 * @var boolean - Has twig been initialized?
	 */
	protected $twig_launched = false;

	/**
	 * Get the current twig root path
	 * @return string - The current twig root path in use.
	 */
	public function getTwigRootPath()
	{
		return $this->twig_root_path;
	}

	/**
	 * Set the root directory for Twig's include files.
	 * @param string $twig_root_path - The root directory that contains Twig's include files (should directly contain the twig autoloader).
	 * @return \OpenFlame\Framework\Template\Twig - Provides a fluent interface.
	 *
	 * @throws \InvalidArgumentException
	 */
	public function setTwigRootPath($twig_root_path)
	{
		$twig_root_path = rtrim($twig_root_path, '/') . '/';
		if(!is_file($twig_root_path . 'Autoloader.php'))
		{
			throw new \InvalidArgumentException(sprintf('Could not locate the Twig autoloader at "%1$s"', $twig_root_path . '/lib/Twig/Autoloader.php'));
		}

		$this->twig_root_path = $twig_root_path;

		return $this;
	}

	/**
	 * Get the current twig cache path.
	 * @param string - The current twig cache path in use.
	 */
	public function getTwigCachePath()
	{<commit_msg>Fix issue with misleading exception message<commit_after><?php
/**
 *
 * @package     openflame-framework
 * @subpackage  twig
 * @copyright   (c) 2010 - 2011 openflame-project.org
 * @license     http://opensource.org/licenses/mit-license.php The MIT License
 * @link        https://github.com/OpenFlame/OpenFlame-Framework
 *
 * Minimum Requirement: PHP 5.3.0
 */

namespace OpenFlame\Framework\Twig;
use OpenFlame\Framework\Core;

/**
 * OpenFlame Framework - Twig management class
 * 	     Basically sets up Twig for use by the OpenFlame Framework.
 *
 *
 * @license     http://opensource.org/licenses/mit-license.php The MIT License
 * @link        https://github.com/OpenFlame/OpenFlame-Framework
 */
class Wrapper
{
	/**
	 * @var string - The path to the root directory of twig's include files.
	 */
	protected $twig_root_path = '';

	/**
	 * @var string - The path to the cache directory that we want to use for Twig.
	 */
	protected $twig_cache_path = '';

	/**
	 * @var array - The array of template paths to load from.
	 */
	protected $template_paths = array();

	/**
	 * @var array - The options to set when instantiating the twig environment object
	 */
	protected $twig_environment_options = array();

	/**
	 * @var \Twig_Loader_Filesystem - The twig filesystem loader object.
	 */
	protected $twig_loader;

	/**
	 * @var \Twig_Loader_Chain - The twig chain loader object.
	 */
	protected $twig_chain_loader;

	/**
	 * @var array - Array of additional twig loaders to use (Twig_Loader_Filesystem will always come first)
	 */
	protected $extra_twig_loaders = array();

	/**
	 * @var \Twig_Environment - The twig environment object.
	 */
	protected $twig_environment;

	/**
	 * @var boolean - Has twig been initialized?
	 */
	protected $twig_launched = false;

	/**
	 * Get the current twig root path
	 * @return string - The current twig root path in use.
	 */
	public function getTwigRootPath()
	{
		return $this->twig_root_path;
	}

	/**
	 * Set the root directory for Twig's include files.
	 * @param string $twig_root_path - The root directory that contains Twig's include files (should directly contain the twig autoloader).
	 * @return \OpenFlame\Framework\Template\Twig - Provides a fluent interface.
	 *
	 * @throws \InvalidArgumentException
	 */
	public function setTwigRootPath($twig_root_path)
	{
		$twig_root_path = rtrim($twig_root_path, '/') . '/';
		if(!is_file($twig_root_path . 'Autoloader.php'))
		{
			throw new \InvalidArgumentException(sprintf('Could not locate the Twig autoloader at "%1$s"', $twig_root_path . 'Autoloader.php'));
		}

		$this->twig_root_path = $twig_root_path;

		return $this;
	}

	/**
	 * Get the current twig cache path.
	 * @param string - The current twig cache path in use.
	 */
	public function getTwigCachePath()
	{
{'fraction_non_alphanumeric': 0.11623282718727404, 'fraction_numerical': 0.004338394793926247, 'mean_word_length': 3.3464257659073056, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '2174087', 'n_tokens_mistral': 1882, 'n_tokens_neox': 1738, 'n_words': 513}