Checks if $query is one of the available editors

@param string $query The string to search for
@return bool Returns true if found, false if not
340639
public function is_related($query) {
        if (parent::is_related($query)) {
            return true;
        }

        $editors_available = editors_get_available();
        foreach ($editors_available as $editor=>$editorstr) {
            if (strpos($editor, $query) !== false) {
                return true;
            }
            if (strpos(core_text::strtolower($editorstr), $query) !== false) {
                return true;
            }
        }
        return false;
    }
1076673
public function search($query) {
        global $CFG;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        $repositories= core_component::get_plugin_list('repository');
        foreach ($repositories as $p => $dir) {
            if (strpos($p, $query) !== false) {
                $found = true;
                break;
            }
        }
        if (!$found) {
            foreach (repository::get_types() as $instance) {
                $title = $instance->get_typename();
                if (strpos(core_text::strtolower($title), $query) !== false) {
                    $found = true;
                    break;
                }
            }
        }

        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
1308894
protected function selectQuerySource(&$query)
    {
        foreach ($query['trace'] as $i => &$trace) {
            $isSource = true;
            foreach ($this->getNamespacesCutoff() as $namespace) {
                $namespace = trim($namespace, '/\\').'\\';
                if (isset($trace['class']) && strpos($trace['class'], $namespace) !== false) {
                    $isSource = false;
                }
            }
            if ($isSource) {
                $query['trace'][$i - 1]['query_source'] = true;
                break;
            }
        }
    }
784048
static function isWriteQuery($query) {
    $q = " " . strtolower(preg_replace("/\\s/i", " ", $query)) . " ";
    return strpos($q, " update ") !== false ||
      strpos($q, " insert ") !== false ||
      strpos($q, " delete ") !== false ||
      strpos($q, " create table ") !== false ||
      strpos($q, " alter table ") !== false ||
      strpos($q, " drop table ") !== false ||
      strpos($q, " show tables ") !== false ||
      strpos($q, " from migrations ") !== false;
  }
217302
static public function isSql($query)
    {
        if (is_string($query) && !is_numeric($query)) {
            if (preg_match('/^\s*(select|insert|update|delete|show|create|alter|rename|drop|grant|revoke|exec|TRUNCATE|set|declare)\s+/i', $query)) {
                return true;
            }
        }
        return false;
    }
461650
public function search($query) {
        global $CFG, $DB;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        if ($processors = get_message_processors()) {
            foreach ($processors as $processor) {
                if (!$processor->available) {
                    continue;
                }
                if (strpos($processor->name, $query) !== false) {
                    $found = true;
                    break;
                }
                $strprocessorname = get_string('pluginname', 'message_'.$processor->name);
                if (strpos(core_text::strtolower($strprocessorname), $query) !== false) {
                    $found = true;
                    break;
                }
            }
        }
        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
255854
public function postFilterQuery($query)
    {
        // @TODO: Is this still right?
        global $pagenow;

        $vars = &$query->query_vars;

        if ($pagenow == 'edit.php' && isset($vars[$this->name]) && is_numeric($vars[$this->name]) && $vars[$this->name]) {
            $term = get_term_by('id', $vars[$this->name], $this->name);

            $vars[$this->name] = $term->slug;
        }

        return $vars;
    }
1108966
public static function Query(string $query)
        {
            if (!$query) {
                return false;
            }

            self::$queriesCnt++;
            $res = pg_query(self::GetConnection(), $query);

            if (!$res) {
                $backtrace = debug_backtrace();

                Log::Write('db',
                           "Error occurred while performing PostgreSQL query." .
                           "\n\tError: " . pg_last_error(self::GetConnection()) .
                           "\n\tCalled in {$backtrace[1]['file']} at line {$backtrace[1]['line']}",
                           'PostgreSQL',
                           Log::LEVEL_CRITICAL);
            }

            return $res;
        }
584074
protected function shouldLogQuery(SqlQuery $query)
    {
        return $this->config->logAllQueries() &&
            preg_match($this->config->allQueriesPattern(), $query->raw());
    }
883671
public function unprepared( $query )
	{
		$result = $this->db->query( $query );

		return ( $result === false || $this->db->last_error );
	}
609955
public function scopeStillActive($query)
    {
        $query->where(function ($query) {
            return $query->where('start_at', '<=', Carbon::now())->orWhereNull('start_at');
        })
        ->where(function ($query) {
            return $query->where('end_at', '>=', Carbon::now())->orWhereNull('end_at');
        })
        ->where(function ($query) {
            return $query->where('parent_id', 0)->orWhereNull('parent_id');
        });

        return $query;
    }
27185
public function hasQueryHandler(string $code): bool
    {
        return array_key_exists($code, $this->queryHandlers)
            || array_key_exists($code, $this->queryHandlerConfigurations)
            || array_key_exists($code, $this->rawQueryHandlerConfigurations);
    }
267589
public function is_related($query) {
        if (parent::is_related($query)) {
            return true;
        }

        $query = core_text::strtolower($query);
        $enrols = enrol_get_plugins(false);
        foreach ($enrols as $name=>$enrol) {
            $localised = get_string('pluginname', 'enrol_'.$name);
            if (strpos(core_text::strtolower($name), $query) !== false) {
                return true;
            }
            if (strpos(core_text::strtolower($localised), $query) !== false) {
                return true;
            }
        }
        return false;
    }
1277753
protected function isAvailable($query)
    {
        $query->where(function ($query)
        {
            $query->whereNull('reserved_at')->where('available_at', '<=', $this->getTime());
        });
    }
1340078
public function query($query)
	{
        Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'This method is deprecated');
		$db = Eresus_DB::getHandler();
        Eresus_Kernel::log(__METHOD__, LOG_DEBUG, $query);
		$db->exec($query);
		return true;
	}
193938
protected function compileRowConstraint($query)
    {
        $start  = $query->offset + 1;
        $finish = $query->offset + $query->limit;

        if ($query->limit == 1 && is_null($query->offset)) {
            return '= 1';
        }

        if ($query->offset && is_null($query->limit)) {
            return ">= {$start}";
        }

        return "between {$start} and {$finish}";
    }
1228247
private function query($query)
    {
		if(!is_array($query)) {
			return q($query);
		} else {
			foreach($query as $v) {
				q($v);
			}
			return true;
		}
    }