Path in the Gestor bibliotecas/host.php
A leftover of the time when one Gestor served several stores (hosts) in the same database. The three functions read the hosts and hosts_variaveis tables and use $_GESTOR['host-id'] as the default host.
| Function | Returns |
|---|---|
host_url(['opcao' => 'full', 'id_hosts' => …]) |
https://<domain>/ with opcao=full, otherwise just the domain |
host_pub_id(['id_hosts' => …]) |
the host's pub_id column |
host_loja_nome(['id_hosts' => …]) |
the nome variable of the loja-configuracoes module, or Minha Loja <id> |
Defects, for whoever maintains legacy code:
-
The result is cached in the
$_HOSTglobal regardless ofid_hosts: a second call with another host returns the first one's value. -
host_pub_id()ignores theid_hostsit receives in the query and always uses$_GESTOR['host-id']. -
host_url()withoutopcaoraises an undefined-variable warning. -
id_hostsgoes into the SQL unescaped.
The only caller in the core is interface.php, in the image fields that look for thumbnails in hosts_arquivos, a branch that also depends on the missing tables.
Functions
Generated from gestor/bibliotecas/host.php · 3 functions
host_url
view source · line 38 ↗host_url(array|false $params = false): string|falseRetorna a URL do host.
Parameters
$paramsarray|false- Parâmetros da função.
Returns
host_pub_id
view source · line 98 ↗host_pub_id(array|false $params = false): string|falseRetorna o identificador público (pubID) do host.
Parameters
$paramsarray|false- Parâmetros da função.
Returns
host_loja_nome
view source · line 148 ↗host_loja_nome(array|false $params = false): string|falseRetorna o nome da loja configurado para o host.
Parameters
$paramsarray|false- Parâmetros da função.
Returns