wordpress/wp-content/plugins/sqlite-integration/query_create.class.php
/**
	 * Method to change the MySQL field types to SQLite compatible types.
	 *
	 * If column name is the same as the key value, e.g. "date" or "timestamp",
	 * and the column is on the top of the line, we add a single quote and avoid
	 * to be replaced. But this doesn't work if that column name is in the middle
	 * of the line.
	 * Order of the key value is important. Don't change it.
	 *
	 * @access private
	 */
Method to change the MySQL field types to SQLite compatible types.
If column name is the same as the key value, e.g. "date" or "timestamp",
and the column is on the top of the line, we add a single quote and avoid
to be replaced. But this doesn't work if that column name is in the middle
of the line.
Order of the key value is important. Don't change it.

@access private
Method to change the MySQL field types to SQLite compatible types . If column name is the same as the key value e . g . " date " or " timestamp " and the column is on the top of the line we add a single quote and avoid to be replaced . But this doesn ' t work if that column name is in the middle of the line . Order of the key value is important . Don ' t change it . @access private
private function rewrite_field_types(){
		$array_types = array (
			'bit'        => 'integer', 'bool'       => 'integer',
			'boolean'    => 'integer', 'tinyint'    => 'integer',
			'smallint'   => 'integer', 'mediumint'  => 'integer',
			'int'        => 'integer', 'integer'    => 'integer',
			'bigint'     => 'integer', 'float'      => 'real',
			'double'     => 'real',    'decimal'    => 'real',
			'dec'        => 'real',    'numeric'    => 'real',
			'fixed'      => 'real',    'date'       => 'text',
			'datetime'   => 'text',    'timestamp'  => 'text',
			'time'       => 'text',    'year'       => 'text',
			'char'       => 'text',    'varchar'    => 'text',
			'binary'     => 'integer', 'varbinary'  => 'blob',
			'tinyblob'   => 'blob',    'tinytext'   => 'text',
			'blob'       => 'blob',    'text'       => 'text',
			'mediumblob' => 'blob',    'mediumtext' => 'text',
			'longblob'   => 'blob',    'longtext'   => 'text'
		);
		foreach ($array_types as $o => $r){
			if (preg_match("/^\\s*(?<!')$o\\s+(.+$)/im", $this->_query, $match)) {
				$ptrn = "/$match[1]/im";
				$replaced = str_ireplace($ptrn, '#placeholder#', $this->_query);
				$replaced = str_ireplace($o, "'{$o}'", $replaced);
				$this->_query = str_replace('#placeholder#', $ptrn, $replaced);
			}
			$pattern = "/\\b(?<!')$o\\b\\s*(\([^\)]*\)*)?\\s*/ims";
			if (preg_match("/^\\s*.*?\\s*\(.*?$o.*?\)/im", $this->_query)) {
				;
			} else {
				$this->_query = preg_replace($pattern, " $r ", $this->_query);
			}
		}
	}
private function rewrite_field_types ( ) { $ array_types = array ( 'bit' => 'integer' , 'bool' => 'integer' , 'boolean' => 'integer' , 'tinyint' => 'integer' , 'smallint' => 'integer' , 'mediumint' => 'integer' , 'int' => 'integer' , 'integer' => 'integer' , 'bigint' => 'integer' , 'float' => 'real' , 'double' => 'real' , 'decimal' => 'real' , 'dec' => 'real' , 'numeric' => 'real' , 'fixed' => 'real' , 'date' => 'text' , 'datetime' => 'text' , 'timestamp' => 'text' , 'time' => 'text' , 'year' => 'text' , 'char' => 'text' , 'varchar' => 'text' , 'binary' => 'integer' , 'varbinary' => 'blob' , 'tinyblob' => 'blob' , 'tinytext' => 'text' , 'blob' => 'blob' , 'text' => 'text' , 'mediumblob' => 'blob' , 'mediumtext' => 'text' , 'longblob' => 'blob' , 'longtext' => 'text' ) ; foreach ( $ array_types as $ o => $ r ) { if ( preg_match ( " /^ \\ s*(?<!') $ o \\ s+(.+$)/im " , $ this -> _query , $ match ) ) { $ ptrn = " / $ match [ 1 ] /im " ; $ replaced = str_ireplace ( $ ptrn , '#placeholder#' , $ this -> _query ) ; $ replaced = str_ireplace ( $ o , " ' { $ o } ' " , $ replaced ) ; $ this -> _query = str_replace ( '#placeholder#' , $ ptrn , $ replaced ) ; } $ pattern = " / \\ b(?<!') $ o \\ b \\ s*(\([^\)]*\)*)? \\ s*/ims " ; if ( preg_match ( " /^ \\ s*.*? \\ s*\(.*? $ o .*?\)/im " , $ this -> _query ) ) { ; } else { $ this -> _query = preg_replace ( $ pattern , " $ r " , $ this -> _query ) ; } } }
Method to change the MySQL field types to SQLite compatible types.
Method to change the MySQL field types to SQLite compatible types .