<commit_before><?php
class DevmoCore {
	public static $debug = false;
	public static $paths = array('controllers'=>array(),'views'=>array(),'libraries'=>array(),'daos'=>array());
	public static $folders = array('controllers'=>'controllers','views'=>'views','libraries'=>'libraries','daos'=>'daos');
	public static $mappings = array();
	public static $homeController = null;
	public static $requestedController = null;

  public static function execute ($name=false,$data=null) {
  	// find controller
  	if ($name) {
  		$controller = $name;
		} else if (self::$requestedController) {
			$controller = self::$requestedController;
		} else {
			$controller = self::$homeController;
		}
  	//	get controller view
    if (!$view = self::executeController($controller,$data))
	    throw new DevmoCoreException('ViewNotFound',array('controller'=>'?'));
    return $view;
  }


  private static function executeController ($path, $data=null, $message=null) {
		// find mapped controller
  	if (self::$mappings) {
			foreach (self::$mappings as $pattern=>$usePath) {
				if (preg_match($pattern,$path)) {
					$path = $usePath;
					break;
				}
			}
		}
    //  get controller object
		$controller = Devmo::getController($path);
		if ($data)
			$controller->setData($data);
		if ($message)
    	$controller->setMessage($message);
		//	run controller
    $view = $controller->run();
    //  forward to next controller
    if ($controller->getForward())
      return self::executeController($controller->getForward(),$data,$message);<commit_msg>Preventing instantiation of Controller due to PATH_INFO = /<commit_after><?php
class DevmoCore {
	public static $debug = false;
	public static $paths = array('controllers'=>array(),'views'=>array(),'libraries'=>array(),'daos'=>array());
	public static $folders = array('controllers'=>'controllers','views'=>'views','libraries'=>'libraries','daos'=>'daos');
	public static $mappings = array();
	public static $homeController = null;
	public static $requestedController = null;

  public static function execute ($name=false,$data=null) {
  	// find controller
  	if ($name) {
  		$controller = $name;
	} else if (self::$requestedController) {
		$controller = self::$requestedController;
	}
	if (!$controller || $controller === '/') {
		$controller = self::$homeController;
	}
  	//	get controller view
    if (!$view = self::executeController($controller,$data))
	    throw new DevmoCoreException('ViewNotFound',array('controller'=>'?'));
    return $view;
  }


  private static function executeController ($path, $data=null, $message=null) {
		// find mapped controller
  	if (self::$mappings) {
			foreach (self::$mappings as $pattern=>$usePath) {
				if (preg_match($pattern,$path)) {
					$path = $usePath;
					break;
				}
			}
		}
    //  get controller object
		$controller = Devmo::getController($path);
		if ($data)
			$controller->setData($data);
		if ($message)
    	$controller->setMessage($message);
		//	run controller
    $view = $controller->run();
    //  forward to next controller
    if ($controller->getForward())
      return self::executeController($controller->getForward(),$data,$message);
{'fraction_non_alphanumeric': 0.17163705583756345, 'fraction_numerical': 0.0, 'mean_word_length': 4.590425531914893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '1739452', 'n_tokens_mistral': 984, 'n_tokens_neox': 936, 'n_words': 210}