web/app/db.php
/**
	 * Determine the likelihood that this query could alter anything
	 * @param string query
	 * @return bool
	 */
Determine the likelihood that this query could alter anything
@param string query
@return bool
Determine the likelihood that this query could alter anything @param string query @return bool
function is_write_query( $q ) {
		$q = ltrim($q, "\r\n\t (");
		return !preg_match('/^(?:SELECT|SHOW|DESCRIBE|DESC|EXPLAIN)\s/i', $q);
	}
function is_write_query ( $ q ) { $ q = ltrim ( $ q , " \r \n \t  ( " ) ; return ! preg_match ( '/^(?:SELECT|SHOW|DESCRIBE|DESC|EXPLAIN)\s/i' , $ q ) ; }
Determine the likelihood that this query could alter anything
 @param string query
 @return bool
Determine the likelihood that this query could alter anything @param string query @return bool
// Quick and dirty: only SELECT statements are considered read-only.