wordpress/wp-content/plugins/sqlite-integration/query_alter.class.php
/**
	 * Function to handle single command.
	 *
	 * @access private
	 * @param array of string $queries
	 * @return string
	 */
Function to handle single command.
@access private
@param array of string $queries
@return string
Function to handle single command . @access private @param array of string $queries @return string
private function handle_single_command($queries) {
		$tokenized_query = $queries;
		if (stripos($tokenized_query['command'], 'add column') !== false) {
			$column_def = $this->convert_field_types($tokenized_query['column_name'], $tokenized_query['column_def']);
			$query = "ALTER TABLE {$tokenized_query['table_name']} ADD COLUMN {$tokenized_query['column_name']} $column_def";
		} elseif (stripos($tokenized_query['command'], 'rename') !== false) {
			$query = "ALTER TABLE {$tokenized_query['table_name']} RENAME TO {$tokenized_query['column_name']}";
		} elseif (stripos($tokenized_query['command'], 'add index') !== false) {
			$unique = isset($tokenized_query['unique']) ? 'UNIQUE' : '';
			$query = "CREATE $unique INDEX IF NOT EXISTS {$tokenized_query['index_name']} ON {$tokenized_query['table_name']} {$tokenized_query['column_name']}";
		} elseif (stripos($tokenized_query['command'], 'drop index') !== false) {
			$query = "DROP INDEX IF EXISTS {$tokenized_query['index_name']}";
		} else {
			$query = 'SELECT 1=1';
		}
		return $query;
	}
private function handle_single_command ( $ queries ) { $ tokenized_query = $ queries ; if ( stripos ( $ tokenized_query [ 'command' ] , 'add column' ) !== false ) { $ column_def = $ this -> convert_field_types ( $ tokenized_query [ 'column_name' ] , $ tokenized_query [ 'column_def' ] ) ; $ query = " ALTER TABLE  { $ tokenized_query [ 'table_name' ] }  ADD COLUMN  { $ tokenized_query [ 'column_name' ] } $ column_def " ; } elseif ( stripos ( $ tokenized_query [ 'command' ] , 'rename' ) !== false ) { $ query = " ALTER TABLE  { $ tokenized_query [ 'table_name' ] }  RENAME TO  { $ tokenized_query [ 'column_name' ] } " ; } elseif ( stripos ( $ tokenized_query [ 'command' ] , 'add index' ) !== false ) { $ unique = isset ( $ tokenized_query [ 'unique' ] ) ? 'UNIQUE' : '' ; $ query = " CREATE  $ unique  INDEX IF NOT EXISTS  { $ tokenized_query [ 'index_name' ] }  ON  { $ tokenized_query [ 'table_name' ] } { $ tokenized_query [ 'column_name' ] } " ; } elseif ( stripos ( $ tokenized_query [ 'command' ] , 'drop index' ) !== false ) { $ query = " DROP INDEX IF EXISTS  { $ tokenized_query [ 'index_name' ] } " ; } else { $ query = 'SELECT 1=1' ; } return $ query ; }
Function to handle single command.
Function to handle single command .