wordpress/wp-content/plugins/sqlite-integration/pdoengine.class.php
/**
	 * Method to determine which query type the argument is.
	 *
	 * It takes the query string ,determines the type and returns the type string.
	 * If the query is the type that SQLite Integration can't executes, returns false.
	 *
	 * @param string $query
	 * @return boolean|string
	 */
Method to determine which query type the argument is.
It takes the query string ,determines the type and returns the type string.
If the query is the type that SQLite Integration can't executes, returns false.

@param string $query
@return boolean|string
Method to determine which query type the argument is . It takes the query string determines the type and returns the type string . If the query is the type that SQLite Integration can ' t executes returns false . @param string $query @return boolean|string
private function determine_query_type($query) {
		$result = preg_match('/^\\s*(SET|EXPLAIN|PRAGMA|SELECT\\s*FOUND_ROWS|SELECT|INSERT|UPDATE|REPLACE|DELETE|ALTER|CREATE|DROP\\s*INDEX|DROP|SHOW\\s*\\w+\\s*\\w+\\s*|DESCRIBE|DESC|TRUNCATE|OPTIMIZE|CHECK|ANALYZE)/i', $query, $match);
		if (!$result) {
			return false;
		}
		$this->query_type = strtolower($match[1]);
		if (stripos($this->query_type, 'found') !== false) {
			$this->query_type = 'foundrows';
		}
		if (stripos($this->query_type, 'show') !== false) {
			if (stripos($this->query_type, 'show table status') !== false) {
				$this->query_type = 'showstatus';
			} elseif (stripos($this->query_type, 'show tables') !== false || stripos($this->query_type, 'show full tables') !== false) {
				$this->query_type = 'show';
			} elseif (stripos($this->query_type, 'show columns') !== false || stripos($this->query_type, 'show fields') !== false || stripos($this->query_type, 'show full columns') !== false) {
				$this->query_type = 'showcolumns';
			} elseif (stripos($this->query_type, 'show index') !== false || stripos($this->query_type, 'show indexes') !== false || stripos($this->query_type, 'show keys') !== false) {
				$this->query_type = 'showindex';
			} elseif (stripos($this->query_type, 'show variables') !== false || stripos($this->query_type, 'show global variables') !== false || stripos($this->query_type, 'show session variables') !== false) {
				$this->query_type = 'show_variables';
			} else {
				return false;
			}
		}
		if (stripos($this->query_type, 'drop index') !== false) {
			$this->query_type = 'drop_index';
		}
		return true;
	}
private function determine_query_type ( $ query ) { $ result = preg_match ( '/^\\s*(SET|EXPLAIN|PRAGMA|SELECT\\s*FOUND_ROWS|SELECT|INSERT|UPDATE|REPLACE|DELETE|ALTER|CREATE|DROP\\s*INDEX|DROP|SHOW\\s*\\w+\\s*\\w+\\s*|DESCRIBE|DESC|TRUNCATE|OPTIMIZE|CHECK|ANALYZE)/i' , $ query , $ match ) ; if ( ! $ result ) { return false ; } $ this -> query_type = strtolower ( $ match [ 1 ] ) ; if ( stripos ( $ this -> query_type , 'found' ) !== false ) { $ this -> query_type = 'foundrows' ; } if ( stripos ( $ this -> query_type , 'show' ) !== false ) { if ( stripos ( $ this -> query_type , 'show table status' ) !== false ) { $ this -> query_type = 'showstatus' ; } elseif ( stripos ( $ this -> query_type , 'show tables' ) !== false || stripos ( $ this -> query_type , 'show full tables' ) !== false ) { $ this -> query_type = 'show' ; } elseif ( stripos ( $ this -> query_type , 'show columns' ) !== false || stripos ( $ this -> query_type , 'show fields' ) !== false || stripos ( $ this -> query_type , 'show full columns' ) !== false ) { $ this -> query_type = 'showcolumns' ; } elseif ( stripos ( $ this -> query_type , 'show index' ) !== false || stripos ( $ this -> query_type , 'show indexes' ) !== false || stripos ( $ this -> query_type , 'show keys' ) !== false ) { $ this -> query_type = 'showindex' ; } elseif ( stripos ( $ this -> query_type , 'show variables' ) !== false || stripos ( $ this -> query_type , 'show global variables' ) !== false || stripos ( $ this -> query_type , 'show session variables' ) !== false ) { $ this -> query_type = 'show_variables' ; } else { return false ; } } if ( stripos ( $ this -> query_type , 'drop index' ) !== false ) { $ this -> query_type = 'drop_index' ; } return true ; }
Method to determine which query type the argument is.
Method to determine which query type the argument is .