wordpress/wp-content/plugins/sqlite-integration/query_create.class.php
/**
	 * Function to rewrite query.
	 *
	 * @param string $query	the query being processed
	 * @return string|array	the processed (rewritten) query
	 */
Function to rewrite query.
@param string $query the query being processed
@return string|array the processed (rewritten) query
Function to rewrite query . @param string $query the query being processed @return string|array the processed ( rewritten ) query
public function rewrite_query($query){
		$this->_query     = $query;
		$this->_errors [] = '';
		if (preg_match('/^CREATE\\s*(UNIQUE|FULLTEXT|)\\s*INDEX/ims', $this->_query, $match)) {
			if (isset($match[1]) && stripos($match[1], 'fulltext') !== false) {
				return 'SELECT 1=1';
			} else {
				return $this->_query;
			}
		} elseif (preg_match('/^CREATE\\s*(TEMP|TEMPORARY|)\\s*TRIGGER\\s*/im', $this->_query)) {
			return $this->_query;
		}
		$this->strip_backticks();
		$this->quote_illegal_field();
		$this->get_table_name();
		$this->rewrite_comments();
		$this->rewrite_field_types();
		$this->rewrite_character_set();
		$this->rewrite_engine_info();
		$this->rewrite_unsigned();
		$this->rewrite_autoincrement();
		$this->rewrite_primary_key();
		$this->rewrite_foreign_key();
		$this->rewrite_unique_key();
		$this->rewrite_enum();
		$this->rewrite_set();
		$this->rewrite_key();
		$this->add_if_not_exists();
		return $this->post_process();
	}
public function rewrite_query ( $ query ) { $ this -> _query = $ query ; $ this -> _errors [ ] = '' ; if ( preg_match ( '/^CREATE\\s*(UNIQUE|FULLTEXT|)\\s*INDEX/ims' , $ this -> _query , $ match ) ) { if ( isset ( $ match [ 1 ] ) && stripos ( $ match [ 1 ] , 'fulltext' ) !== false ) { return 'SELECT 1=1' ; } else { return $ this -> _query ; } } elseif ( preg_match ( '/^CREATE\\s*(TEMP|TEMPORARY|)\\s*TRIGGER\\s*/im' , $ this -> _query ) ) { return $ this -> _query ; } $ this -> strip_backticks ( ) ; $ this -> quote_illegal_field ( ) ; $ this -> get_table_name ( ) ; $ this -> rewrite_comments ( ) ; $ this -> rewrite_field_types ( ) ; $ this -> rewrite_character_set ( ) ; $ this -> rewrite_engine_info ( ) ; $ this -> rewrite_unsigned ( ) ; $ this -> rewrite_autoincrement ( ) ; $ this -> rewrite_primary_key ( ) ; $ this -> rewrite_foreign_key ( ) ; $ this -> rewrite_unique_key ( ) ; $ this -> rewrite_enum ( ) ; $ this -> rewrite_set ( ) ; $ this -> rewrite_key ( ) ; $ this -> add_if_not_exists ( ) ; return $ this -> post_process ( ) ; }
Function to rewrite query.
Function to rewrite query .
// we manipulate CREATE INDEX query in PDOEngine.class.php // FULLTEXT index creation is simply ignored. // if WordPress comes to use foreign key constraint, trigger will be needed. // we don't use it for now.