wordpress/wp-content/plugins/sqlite-integration/query.class.php
/**
	 * Method to rewrite a query string for SQLite to execute.
	 *
	 * @param strin $query
	 * @param string $query_type
	 * @return string
	 */
Method to rewrite a query string for SQLite to execute.
@param strin $query
@param string $query_type
@return string
Method to rewrite a query string for SQLite to execute . @param strin $query @param string $query_type @return string
public function rewrite_query($query, $query_type){
		$this->query_type = $query_type;
		$this->_query = $query;
		$this->parse_query();
		switch ($this->query_type) {
			case 'truncate':
				$this->handle_truncate_query();
				break;
			case 'alter':
				$this->handle_alter_query();
				break;
			case 'create':
				$this->handle_create_query();
				break;
			case 'describe':
			case 'desc':
				$this->handle_describe_query();
				break;
			case 'show':
				$this->handle_show_query();
				break;
			case 'showcolumns':
				$this->handle_show_columns_query();
				break;
			case 'showindex':
				$this->handle_show_index();
				break;
			case 'select':
				$this->handle_sql_count();
				$this->rewrite_date_sub();
				$this->delete_index_hints();
				$this->rewrite_regexp();
				$this->fix_date_quoting();
				$this->rewrite_between();
				$this->handle_orderby_field();
				break;
			case 'insert':
				$this->execute_duplicate_key_update();
				$this->rewrite_insert_ignore();
				$this->rewrite_regexp();
				$this->fix_date_quoting();
				break;
			case 'update':
				$this->rewrite_update_ignore();
				$this->rewrite_limit_usage();
				$this->rewrite_order_by_usage();
				$this->rewrite_regexp();
				$this->rewrite_between();
				break;
			case 'delete':
				$this->rewrite_limit_usage();
				$this->rewrite_order_by_usage();
				$this->rewrite_date_sub();
				$this->rewrite_regexp();
				$this->delete_workaround();
				break;
			case 'replace':
				$this->rewrite_date_sub();
				$this->rewrite_regexp();
				break;
			case 'optimize':
				$this->rewrite_optimize();
				break;
			case 'pragma':
				break;
			default:
				if (defined(WP_DEBUG) && WP_DEBUG) {
					break;
				} else {
					$this->return_true();
					break;
				}
		}
		return $this->_query;
	}
public function rewrite_query ( $ query , $ query_type ) { $ this -> query_type = $ query_type ; $ this -> _query = $ query ; $ this -> parse_query ( ) ; switch ( $ this -> query_type ) { case 'truncate' : $ this -> handle_truncate_query ( ) ; break ; case 'alter' : $ this -> handle_alter_query ( ) ; break ; case 'create' : $ this -> handle_create_query ( ) ; break ; case 'describe' : case 'desc' : $ this -> handle_describe_query ( ) ; break ; case 'show' : $ this -> handle_show_query ( ) ; break ; case 'showcolumns' : $ this -> handle_show_columns_query ( ) ; break ; case 'showindex' : $ this -> handle_show_index ( ) ; break ; case 'select' : $ this -> handle_sql_count ( ) ; $ this -> rewrite_date_sub ( ) ; $ this -> delete_index_hints ( ) ; $ this -> rewrite_regexp ( ) ; $ this -> fix_date_quoting ( ) ; $ this -> rewrite_between ( ) ; $ this -> handle_orderby_field ( ) ; break ; case 'insert' : $ this -> execute_duplicate_key_update ( ) ; $ this -> rewrite_insert_ignore ( ) ; $ this -> rewrite_regexp ( ) ; $ this -> fix_date_quoting ( ) ; break ; case 'update' : $ this -> rewrite_update_ignore ( ) ; $ this -> rewrite_limit_usage ( ) ; $ this -> rewrite_order_by_usage ( ) ; $ this -> rewrite_regexp ( ) ; $ this -> rewrite_between ( ) ; break ; case 'delete' : $ this -> rewrite_limit_usage ( ) ; $ this -> rewrite_order_by_usage ( ) ; $ this -> rewrite_date_sub ( ) ; $ this -> rewrite_regexp ( ) ; $ this -> delete_workaround ( ) ; break ; case 'replace' : $ this -> rewrite_date_sub ( ) ; $ this -> rewrite_regexp ( ) ; break ; case 'optimize' : $ this -> rewrite_optimize ( ) ; break ; case 'pragma' : break ; default : if ( defined ( WP_DEBUG ) && WP_DEBUG ) { break ; } else { $ this -> return_true ( ) ; break ; } } return $ this -> _query ; }
Method to rewrite a query string for SQLite to execute.
Method to rewrite a query string for SQLite to execute .
//$this->strip_backticks(); //$this->rewrite_boolean(); //$this->safe_strip_backticks(); //$this->safe_strip_backticks(); //$this->_rewrite_date_sub(); //$this->strip_backticks(); //$this->safe_strip_backticks();