<commit_before><?php
/**
 * Tera_WURFL - PHP MySQL driven WURFL
 * 
 * Tera-WURFL was written by <NAME>, and is based on the
 * Java WURFL Evolution package by <NAME> and WURFL PHP Tools by <NAME>.
 * This version uses a MySQL database to store the entire WURFL file, multiple patch
 * files, and a persistent caching mechanism to provide extreme performance increases.
 * 
 * @package TeraWurflDatabase
 * @author <NAME> <<EMAIL> AT <EMAIL>>
 * @version Stable 2.1.3 $Date: 2010/07/29 20:36:29
 * @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
 */
/**
 * Provides connectivity from Tera-WURFL to Microsoft SQL Server 2005/2008
 * @package TeraWurflDatabase
 */
class TeraWurflDatabase_MSSQL2005 extends TeraWurflDatabase{
	
	// Properties
	public $errors;
	public $db_implements_ris = true;
	public $db_implements_ld = false;
	public $numQueries = 0;
	public $connected = false;
	
	protected $dbcon;
	
	public $maxquerysize = 0;
	/**
	 * The maximum number of new rows that the database can handle in one INSERT statement
	 * @var unknown_type
	 */
	protected static $DB_MAX_INSERTS = 500;
	
	public function __construct(){
		parent::__construct();
	}
	
	// Device Table Functions (device,hybrid,patch)
	public function getDeviceFromID($wurflID){
		$this->numQueries++;
		$res = sqlsrv_query($this->dbcon,"SELECT * FROM ".TeraWurflConfig::$TABLE_PREFIX.'Merge'." WHERE deviceID=".$this->SQLPrep($wurflID)) or die($this->lastDBError());<commit_msg>Changed defaults for MS SQL Server connector for performance<commit_after><?php
/**
 * Tera_WURFL - PHP MySQL driven WURFL
 * 
 * Tera-WURFL was written by <NAME>, and is based on the
 * Java WURFL Evolution package by <NAME> and WURFL PHP Tools by <NAME>.
 * This version uses a MySQL database to store the entire WURFL file, multiple patch
 * files, and a persistent caching mechanism to provide extreme performance increases.
 * 
 * @package TeraWurflDatabase
 * @author <NAME> <<EMAIL> AT <EMAIL>>
 * @version Stable 2.1.3 $Date: 2010/07/29 20:36:29
 * @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
 */
/**
 * Provides connectivity from Tera-WURFL to Microsoft SQL Server 2005/2008
 * @package TeraWurflDatabase
 */
class TeraWurflDatabase_MSSQL2005 extends TeraWurflDatabase{
	
	// Properties
	public $errors;
	// If you enable this, the RIS function will be performed on the SQL server, HOWEVER,
	//   this is currently MUCH slower (~ x5 slower) than performing this function in PHP
	public $db_implements_ris = false;
	public $db_implements_ld = false;
	public $numQueries = 0;
	public $connected = false;
	
	protected $dbcon;
	
	public $maxquerysize = 0;
	/**
	 * The maximum number of new rows that the database can handle in one INSERT statement
	 * @var unknown_type
	 */
	protected static $DB_MAX_INSERTS = 500;
	
	public function __construct(){
		parent::__construct();
	}
	
	// Device Table Functions (device,hybrid,patch)
	public function getDeviceFromID($wurflID){
		$this->numQueries++;
		$res = sqlsrv_query($this->dbcon,"SELECT * FROM ".TeraWurflConfig::$TABLE_PREFIX.'Merge'." WHERE deviceID=".$this->SQLPrep($wurflID)) or die($this->lastDBError());
{'fraction_non_alphanumeric': 0.10997442455242967, 'fraction_numerical': 0.023337595907928388, 'mean_word_length': 4.376288659793815, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2396373', 'n_tokens_mistral': 1089, 'n_tokens_neox': 968, 'n_words': 329}