Conn2Flow
Docs navigation

Reference / Libraries

host.php library

Legacy of the multi-host mode: host_url(), host_pub_id() and host_loja_nome() query tables that current installations do not have.

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 $_HOST global regardless of id_hosts: a second call with another host returns the first one's value.

  • host_pub_id() ignores the id_hosts it receives in the query and always uses $_GESTOR['host-id'].

  • host_url() without opcao raises an undefined-variable warning.

  • id_hosts goes 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

3 of 3

host_url

view source · line 38 ↗
host_url(array|false $params = false): string|false

Retorna a URL do host.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

string|false
A URL do host no formato solicitado, ou false se o host não for encontrado.

host_pub_id

view source · line 98 ↗
host_pub_id(array|false $params = false): string|false

Retorna o identificador público (pubID) do host.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

string|false
O identificador público do host, ou false se o host não for encontrado.

host_loja_nome

view source · line 148 ↗
host_loja_nome(array|false $params = false): string|false

Retorna o nome da loja configurado para o host.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

string|false
O nome da loja ou false se o host não for encontrado.

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting