<commit_before><?php 

namespace Lighty\Kernel\Database;

use Lighty\Kernel\Config\Config;
use Lighty\Kernel\Database\Drivers\MysqlDatabase;

/**
* Database Class
*/
class Database
{

	static $server=null;
	static $default=null;
	static $serverData=array();
	static $defaultData=array();
	private static $driver=null;

	public static function ini()
	{
		self::$driver=self::getDriver();
		self::$driver->setDefault();
	}

	public static function getDriver()
	{
		switch (Config::get('database.default')) {
			case 'sqlite':
				# code...
				break;

			case 'mysql':
					return (new MysqlDatabase);
				break;

			case 'pgsql':
				# code...
				break;

			case 'sqlsrv':
				# code...
				break;
		}
	}
	
	public static function setDefault($red=false,$url=null)
	{
		self::$driver->setDefault();
	}

	public static function setNewServer($host,$user,$password,$database)
	{
		self::$driver->setNewServer($host,$user,$password,$database);
	}

	public static function setDefaultDB()
	{
		self::$driver->setDefaultDB();
	}

	public static function ChangeDB($database,$server=null)
	{
		self::$driver->ChangeDB($database,$server);
	}



	public static function exec($sql)
	{
		return self::$driver->exec($sql);
	}

	public static function execErr()
	{
		return self::$driver->execErr();
	}

	//assoc : 1 , array : 2
	public static function read($sql,$mode=2)
	{
		return self::$driver->read($sql , $mode);
	}

	public static function countR($res)
	{
		return self::$driver->countR($res);
	}

	public static function countS($sql)
	{
		return self::$driver->countS($sql);
	}

	public static function res($sql)
	{
		return self::$driver->res($sql);
	}

}
<commit_msg>add fun of generation time<commit_after><?php 

namespace Lighty\Kernel\Database;

use Lighty\Kernel\Config\Config;
use Lighty\Kernel\Database\Drivers\MysqlDatabase;
use Lighty\Kernel\Objects\DateTime as Time;

/**
* Database Class
*/
class Database
{

	static $server=null;
	static $default=null;
	static $serverData=array();
	static $defaultData=array();
	private static $driver=null;

	public static function ini()
	{
		self::$driver=self::getDriver();
		self::$driver->setDefault();
	}

	public static function getDriver()
	{
		switch (Config::get('database.default')) {
			case 'sqlite':
				# code...
				break;

			case 'mysql':
					return (new MysqlDatabase);
				break;

			case 'pgsql':
				# code...
				break;

			case 'sqlsrv':
				# code...
				break;
		}
	}
	
	public static function setDefault($red=false,$url=null)
	{
		self::$driver->setDefault();
	}

	public static function setNewServer($host,$user,$password,$database)
	{
		self::$driver->setNewServer($host,$user,$password,$database);
	}

	public static function setDefaultDB()
	{
		self::$driver->setDefaultDB();
	}

	public static function ChangeDB($database,$server=null)
	{
		self::$driver->ChangeDB($database,$server);
	}



	public static function exec($sql)
	{
		return self::$driver->exec($sql);
	}

	public static function execErr()
	{
		return self::$driver->execErr();
	}

	//assoc : 1 , array : 2
	public static function read($sql,$mode=2)
	{
		return self::$driver->read($sql , $mode);
	}

	public static function countR($res)
	{
		return self::$driver->countR($res);
	}

	public static function countS($sql)
	{
		return self::$driver->countS($sql);
	}

	public static function res($sql)
	{
		return self::$driver->res($sql);
	}

	public static function export()
	{

	}

	/**
	 * Get the time of generation of the database
	 */
	protected static function exportTime()
	{
		$now = Time::now();
		$current = Time::current();
		//
		return "-- Generated in $current ($now)";
	}

}

{'fraction_non_alphanumeric': 0.1646896551724138, 'fraction_numerical': 0.0016551724137931034, 'mean_word_length': 4.00828729281768, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1328470', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1212, 'n_words': 259}