<commit_before><?php 

namespace Vinala\Kernel\Foundation;

use Vinala\Kernel\Router\Routes;

/**
* this class help the framework to get all
* app/ folder files
*/
class Fetcher
{
	/**
	 * Path to app folder
	 */
	protected static $appPath;

	/**
	 * Path to framework folder
	 */
	protected static $frameworkPath;

	/**
	 * Get all required App files
	 */
	public static function run($routes)
	{
		self::setAppPath();
		self::setFrameworkPath();
		//
		self::model();
		self::controller();
		self::link();
		if(Component::isOn("database")) self::seed();
		self::filtes();
		self::routes($routes);
		self::commands();
	}

	/**
	 * Set path to app folder
	 */
	protected static function setAppPath()
	{
		self::$appPath = Application::$root."app/";
		return self::$appPath ; 
	}

	/**
	 * Set path to app folder
	 */
	protected static function setFrameworkPath()
	{
		self::$frameworkPath = Application::$root;
		return self::$frameworkPath ; 
	}

	/**
	 * Fetch files of folder
	 */
	protected static function fetch($pattern,$app = true)
	{
		if($app) return glob(self::$appPath.$pattern.'/*.php');
		else return glob(self::$frameworkPath.$pattern.'/*.php');
	}

	/**
	 * Require files of Models folder
	 */
	protected static function model()
	{
		foreach (self::fetch("models") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Controllers folder
	 */
	protected static function controller()
	{
		foreach (self::fetch("controllers") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Links folder
	 */
	protected static function link()
	{
		foreach (self::fetch("links") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Seeds folder
	 */
	protected static function seed()
	{
		foreach (self::fetch("database/seeds" , false) as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Filters
	 */
	protected static function filtes()
	{
		Connector::need(self::$appPath.'http/Filters.php');
	}
<commit_msg>call user exceptions<commit_after><?php 

namespace Vinala\Kernel\Foundation;

use Vinala\Kernel\Router\Routes;

/**
* this class help the framework to get all
* app/ folder files
*/
class Fetcher
{
	/**
	 * Path to app folder
	 */
	protected static $appPath;

	/**
	 * Path to framework folder
	 */
	protected static $frameworkPath;

	/**
	 * Get all required App files
	 */
	public static function run($routes)
	{
		self::setAppPath();
		self::setFrameworkPath();
		//
		self::exception();
		self::model();
		self::controller();
		self::link();
		if(Component::isOn("database")) self::seed();
		self::filtes();
		self::routes($routes);
		self::commands();

	}

	/**
	 * Set path to app folder
	 */
	protected static function setAppPath()
	{
		self::$appPath = Application::$root."app/";
		return self::$appPath ; 
	}

	/**
	 * Set path to app folder
	 */
	protected static function setFrameworkPath()
	{
		self::$frameworkPath = Application::$root;
		return self::$frameworkPath ; 
	}

	/**
	 * Fetch files of folder
	 */
	protected static function fetch($pattern,$app = true)
	{
		if($app) return glob(self::$appPath.$pattern.'/*.php');
		else return glob(self::$frameworkPath.$pattern.'/*.php');
	}

	/**
	 * Require files of Models folder
	 */
	protected static function model()
	{
		foreach (self::fetch("models") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Controllers folder
	 */
	protected static function controller()
	{
		foreach (self::fetch("controllers") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Links folder
	 */
	protected static function link()
	{
		foreach (self::fetch("links") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of exception folder
	 */
	protected static function exception()
	{
		foreach (self::fetch("exceptions") as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Seeds folder
	 */
	protected static function seed()
	{
		foreach (self::fetch("database/seeds" , false) as $file) 
			Connector::need($file);
	}

	/**
	 * Require files of Filters
	 */
	protected static function filtes()
	{
		Connector::need(self::$appPath.'http/Filters.php');
	}

{'fraction_non_alphanumeric': 0.16303821964199322, 'fraction_numerical': 0.0, 'mean_word_length': 3.6304591265397534, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2198016', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1316, 'n_words': 333}