Conn2Flow
Docs navigation

Reference / Libraries

gestor.php library

The Gestor's support core: components and layouts, per-module texts, page resources, SEO and OpenGraph, restricted access, redirection, database-backed sessions and sanitization of the served HTML.

Path in the Gestor bibliotecas/gestor.php

bibliotecas/gestor.php is the support library used across the whole Gestor and is always loaded. Do not confuse it with gestor/gestor.php, the router, which builds the page on every request and calls these functions. When loaded, it also includes recursos.php if it is not present yet, because every <script>/<link> tag resolves its URL through recursos_url().

Many functions are pure, with no global state: they were extracted from the router (which ends in exit and cannot be included by a test) precisely to be testable.

Basic utilities

  • existe($dado) is the "does it have content?" check used across the core: an array with elements, a string with at least one character, or any truthy value. Beware: existe('0') is true, but existe(0) is false.

  • gestor_asset_version($owner = null, $fallback = null) returns the cache token of an assets directory. It looks in $_GESTOR['asset-versions']['owners'][$owner], then in $_GESTOR['asset-version'], the $fallback and the system version.

  • gestor_modulo_asset_version($modulo) returns the cache token of a module's JS/CSS: asset_version from the module JSON, otherwise versao, otherwise the global token.

  • gestor_modulos_dados($modulo_id) reads and decodes gestor/modulos/<id>/<id>.json. It returns null when the file does not exist, without emitting a warning.

  • gestor_js_variavel_incluir($variavel, $valor) publishes a value to the page's JavaScript in $_GESTOR['javascript-vars'], which the router serializes as a global object. When the variable already exists and both values are arrays, it runs array_merge_recursive; otherwise it overwrites.

System State and Global Variables (GestorState)

The state access layer (GestorState) provides standardized and safe access to the system's global state ($_GESTOR), with fallback support, dot notation and critical key protection:

  • gestor_get(string $chave, mixed $padrao = null): mixed — Retrieves value from global state. Supports dot notation (e.g. gestor_get('banco.conexao.host', 'localhost')).

  • gestor_set(string $chave, mixed $valor): bool — Sets or updates value safely. Blocks accidental mutations of critical system keys.

  • gestor_has(string $chave): bool — Checks key existence in global state (supports dot notation).

  • gestor_contexto(string $escopo): array — Extracts delimited context slice (modulo, usuario, sistema, etc.).

Protected Core Keys

  • raiz-absoluta, url-raiz, linguagem-codigo, versao-num.

  • Modification attempts via gestor_set() are blocked and logged for auditing.

OOP API of GestorState Class

  • GestorState::get($chave, $padrao)

  • GestorState::set($chave, $valor)

  • GestorState::has($chave)

  • GestorState::contexto($escopo)

  • GestorState::proteger(...$chaves) / GestorState::desproteger(...$chaves)

  • GestorState::isProtegida($chave) / GestorState::getChavesProtegidas()

  • GestorState::getAuditoria() / GestorState::reset()

Libraries

gestor_incluir_bibliotecas() and gestor_incluir_biblioteca($name) load libraries by logical name. See Gestor libraries.

A page's CSS framework

A final page is layout + page, and both have framework_css.

  • gestor_framework_css_resolver($layout, $pagina) decides what to load:

    • Fomantic is included when either one declares it, or when neither declares anything (legacy);

    • Tailwind is included when either one declares it.

    • It returns ['fomantic' => bool, 'tailwind' => bool, 'modo' => 'fomantic-ui'|'tailwindcss'|'hibrido'].

  • gestor_framework_css_atual() applies the rule to $_GESTOR['layout#framework_css'] and $_GESTOR['pagina#framework_css'].

Database schema without a 500 error

New code can reach an old database (a failed migration, a files-only update, --skip-migrate, the deploy window). So that the new feature disappears instead of breaking the screen:

  • gestor_schema_tabela_existe($tabela) runs one SHOW TABLES per request (memoized) and also answers false when the database could not be queried;

  • gestor_schema_campo_existe($campo, $tabela) checks the table first and memoizes per table.field, without throwing.

Components and layouts

gestor_componente($params)

Fetches components from the componentes table, in the current language (or in linguagem).

Parameter Effect
id Textual id, or an array of ids (returns [id => ['html' => …]])
id_componentes Numeric id (alternative)
modulo Restricts to the module
return_css Also returns css, css_precompiled, css_compiled and html_extra_head, without adding them to the page
modulosExtra Modules whose variables will also be resolved on the page
  • Without return_css, the component's CSS and html_extra_head go into <head> through gestor_pagina_recursos_incluir(), deduplicated, and only the HTML is returned.

  • With $_GESTOR['development-env'] enabled, the HTML and CSS come from the files in resources/ (core or module), not from the database.

  • Not found: '' (or [] with an array of ids). The query does not filter status.

  • gestor_componente_ids_condicao($ids) builds the escaped (id='a' OR id='b') used by the multiple lookup.

To append components to the end of the page: mark them with gestor_componentes_incluir(['id' => …]) or (['componentes' => [...]]); the router calls gestor_componentes_incluir_pagina(), which renders each marked component and appends it to $_GESTOR['pagina'].

gestor_layout($params)

Same model, on the layouts table (id, id_layouts, return_css, modulosExtra). Differences:

  • it stores the layout's framework_css in $_GESTOR['layout#framework_css'];

  • it includes the precompiled CSS with the layout-precompiled role, so the layout comes first in the cascade;

  • in development, it also reads plugin layouts (plugins/<plugin>/modules/<module>/resources/…);

  • when the layout does not exist, it returns a minimal HTML (<!-- pagina#titulo -->, <!-- pagina#css -->, <!-- pagina#js --> and @[[pagina#corpo]]@).

Page resources (CSS and <head>)

gestor_pagina_recursos_incluir(['css' => …, 'css_precompiled' => …, 'css_precompiled_role' => …, 'css_compiled' => …, 'html_extra_head' => …]) is the only right way for widgets and components to bring CSS into <head>. Each fragment is included only once, deduplicated by MD5 in $_GESTOR['recursos-incluidos-hashes'], and tagged in the DOM:

  • css becomes <style data-c2f-css-role="authored">;

  • css_compiled becomes data-c2f-css-role="compiled";

  • css_precompiled becomes <style data-tailwind-role="…">, with the role layout-precompiled, dependency-precompiled, page-precompiled or resource-precompiled (the default).

gestor_css_precompiled_ordenar($styles) orders the precompiled <style> blocks by role: layout, dependencies, page, resources and the rest. Tailwind v4 cascade layers are defined on first appearance, and the layout must declare theme, base, components, utilities before everything else. With $_GESTOR['tailwind-page-bundle'] (canonical per-page bundle), only the page's blocks and those without a role are kept. Discarded resource-precompiled blocks produce a single log_disco entry in the tailwind category.

CSS audit and provenance

Used by the css:audit and css:rebuild commands and by the CRUDs that store resources:

  • gestor_css_classes_usadas($html) lists the markup's classes, ignoring template markers ([, {, @). That includes Tailwind arbitrary variants such as bg-[rgb(…)].

  • gestor_css_classes_definidas($css) lists the classes a stylesheet defines, unescaping md\:flex.

  • gestor_css_classes_descobertas($html, $css) lists the used-but-undefined ones, except the group and peer markers.

  • gestor_css_classes_em_codigo($codigo) finds classes built in PHP/JS (class="…", classList.add/remove/toggle, className =): the debt that forces declaring tailwind_sources.

  • gestor_css_procedencia_assinatura(['html','css','baseline','compilador']) produces v2:<sha1>: the stamp of which input the derived CSS was generated from. The baseline is the layout's CSS and the compilador is the Tailwind version.

  • gestor_css_compilador_versao() reads that version from the assets-externos.php registry (tailwindcss-browser).

  • gestor_css_procedencia_para_recurso($html, $css, $layout_id, $tabela) returns the signature ready to store in css_source_hash, or '' when the column does not exist yet.

  • gestor_css_procedencia_valida($stored, $params) compares. A missing signature counts as invalid, on purpose.

Text variables (i18n)

Interface texts live in the variaveis table, per language and modulo.

  • gestor_variaveis(['modulo' => …, 'id' => …]) returns the text in the current language. Without modulo, it uses _global_ (modulo IS NULL). It loads the whole module on the first call and caches it in $_GESTOR['variaveis'][$modulo]. Missing: ''. With conjunto => true it returns every variable of the module; padrao filters the ids by a substring, case-insensitively, and reset reloads from the database.

  • gestor_variaveis_globais(['id' => …]) does the single lookup by id and returns null when not found.

  • gestor_variaveis_alterar(['modulo', 'id', 'tipo', 'valor', 'linguagem']) updates the value. With tipo = 'bool', it stores 1/NULL.

gestor_pagina_variaveis_globais(['html' => …]) resolves the @[[…]]@ markers of an HTML, in this order:

  1. the current module's variables ($_GESTOR['modulo-id']);

  2. the extra modules' variables ($_GESTOR['paginas-variaveis']);

  3. the system markers pagina#url-raiz, pagina#url-full-http, pagina#titulo, pagina#contato-url and pagina#url-caminho.

Whatever is not resolved stays in the HTML.

Routes, redirection and query string

  • gestor_redirecionar($local = false, $queryString = '', $externo = false) sends Location and ends with exit.

    • An internal $local is prefixed with $_GESTOR['url-raiz'].

    • Without $local, it uses the redirecionar-local session variable (and deletes it) or the root.

    • The alert in $_GESTOR['pagina-alerta'] is stored in the session for the next page.

  • gestor_redirecionar_montar_url($local, $queryString) joins destination and query with ? or & depending on the destination (req-173).

  • gestor_redirecionar_raiz() goes to the current module's page marked as raiz (or to /).

  • gestor_reload_url() reloads the current path.

  • gestor_querystring($remove = '') returns the current query without the internal _gestor-caminho parameter (and without $remove).

  • gestor_querystring_variavel($qs, $name) reads one parameter.

  • gestor_querystring_remover_variavel($qs, $name) removes one parameter. Values come back decoded, without urlencode.

  • gestor_querystring_before_submit($field, $default) reads the query the form stored in a hidden field (_c2f_query_string_before_submit), already escaped for SQL.

  • gestor_roteador_erro_terminal($codigo, $caminho) tells whether the 404 is already on the 404/ route, to avoid a 404 → 404 loop.

  • gestor_roteador_pagina_status_http($caminho) returns 404 for that page.

  • gestor_pagina_301_registrar($id_paginas, $caminho) records in paginas_301 that the old path belongs to the page, deduplicating by the (path, page) pair.

  • gestor_pagina_rota_sistema($caminho) recognizes the routes that are not content: cookies-is-mandatory, _gestor-cookie-verify, 404, 403, 500 and 503. Tracking scripts are not added to them.

Robots, OpenGraph and SEO

  • gestor_crawler_detectar($userAgent, $tokensExtra = null) compares the lowercased User-Agent, by substring, with:

    • gestor_crawler_tokens_padrao(): WhatsApp, Meta, Googlebot, Bing, Lighthouse, Ahrefs, uptime monitors…;

    • gestor_crawler_tokens_extra(): the list from Environment → Site Settings, which only applies with crawler-tokens-extra-ativo.

  • gestor_crawler_tokens_normalizar($raw) turns text separated by commas, semicolons or line breaks into a list without repetition.

  • gestor_cookie_verificacao_desfecho(['crawler','tem_cookie','exigir_sessao','caminho']) decides between ignorar, emitir and redirecionar in the cookie check. On a system route it never redirects, which avoids the "cookies are mandatory" loop.

  • gestor_open_graph_tags([...]) builds og:title, og:description, og:image, og:url, og:site_name and og:type, plus twitter:card. It never emits an empty tag.

  • gestor_open_graph_existe($html) detects whether the HTML already carries its own; in that case the core does not inject its set.

  • gestor_pagina_og_do_registro($pagina) extracts the filled og_titulo, og_descricao, imagem_destaque, meta_descricao and meta_keywords from the page record.

  • gestor_meta_seo_tags(['description','keywords']) generates the classic meta tags; gestor_meta_seo_existe($html) avoids duplicating them; gestor_meta_keywords_normalizar($raw) cleans up keywords (no repetition, case preserved).

  • gestor_pdf_viewer_detectar($html) checks whether the page has the PDF.js viewer (conn2flow-pdfjs class), and gestor_pdf_viewer_assets($urlRoot, $version) returns the <script> tags (PDF.js 3.11.174 from cdnjs and interface/pdf-viewer.js).

Restricted site access (req-163)

With SITE_RESTRICTED_ACCESS=true in .env, only logged-in users can see the site:

  • gestor_site_acesso_restrito_ativo() reads the key from $_CONFIG and falls back to $_ENV/getenv();

  • gestor_site_acesso_restrito_perfis() returns the id_usuarios_perfis allowed in SITE_RESTRICTED_PROFILES (positive integers only);

  • gestor_site_acesso_restrito_perfil_autorizado($profile, $list) lets any logged-in user in when the list is empty; anonymous users never;

  • gestor_site_acesso_restrito_rota_isenta($caminho) exempts the identity routes (login, sign-up, password recovery, OAuth), _api, api, _gateways and the system routes.

CSRF and menu icons

  • gestor_csrf_rotas_identidade() lists the screens with a single-use token (signin, signin-2fa, signup, forgot-password, reset-password, validate-user).

  • gestor_csrf_destino_recarregamento($path, $referer, $urlRoot) picks which of those screens the CSRF error page should reload, using the current path first and then the referer.

  • gestor_pagina_menu_icone_lucide_valido($name) only accepts kebab-case names, the only ones Lucide resolves.

  • gestor_pagina_menu_icone_lucide_atributo($name) returns data-lucide="…", or nothing for an invalid name, which avoids the icon name was not found warning.

Session

The Gestor session lives in the database: the sessoes and sessoes_variaveis tables. It does not use $_SESSION.

  • gestor_sessao_iniciar() creates the $_CONFIG['session-authname'] cookie with 32 random bytes (seguranca_token_aleatorio()), HttpOnly, SameSite=Lax, domain SERVER_NAME and lifetime session-lifetime (10800 s by default).

  • gestor_cookie_is_secure() decides Secure: always on HTTPS (including behind a proxy, via X-Forwarded-Proto) and always in production; the cookie only goes without Secure on HTTP and with development-env.

  • gestor_sessao_id() returns the numeric session id, creating the row if needed, and updates acesso once per request. In 1 out of every 51 requests it deletes the sessions (and variables) with no access for longer than session-lifetime.

  • gestor_sessao_variavel($name, $value = null) stores (JSON) or reads a value. Missing: ''. There is no way to store null: it means a read.

  • gestor_sessao_variavel_del($name) deletes one variable; gestor_sessao_del() deletes the current session and expires the cookie.

  • gestor_sessao_del_all() deletes every session of every user.

Sanitization of the served HTML (req-132)

In production, the delivered HTML goes out without comments and without indentation.

  • gestor_pagina_higienizar_ativo() reads HTML_SANITIZE:

    • auto (the default) is on in production and off in development;

    • on is always on;

    • off is always off;

    • an unknown value becomes auto.

    • With the live editing bar (gestor_dashboard_toolbar_ativo()), it never sanitizes.

  • gestor_html_higienizar($html) keeps <pre>, <textarea>, <script> and conditional comments; removes HTML comments and CSS comments/indentation inside <style>; replaces indentation with a line break, because whitespace between inline elements is rendered.

  • gestor_js_higienizar($js) is a scanner (not a regex) that respects strings, template literals and regex literals, and keeps line breaks because of ASI. gestor_js_barra_inicia_regex($previous) decides whether a / opens a regex or is a division.

  • gestor_pagina_higienizar_js_ativo() is the dedicated HTML_SANITIZE_JS key to turn off only the JavaScript part.

  • gestor_html_script_e_javascript($tag) only accepts inline JavaScript <script> tags. It ignores src, application/json, text/template and other types used as data storage.

See also

Functions (generated reference)

Generated from gestor/bibliotecas/gestor.php · 84 functions

84 of 84

existe

view source · line 45 ↗
existe(mixed $dado = false): bool

Verifica se um dado existe e não está vazio.

Parameters

$dadomixed
Dado a ser verificado.

Returns

bool
True se existe e não está vazio, false caso contrário.

gestor_get

view source · line 452 ↗
gestor_get(string $chave, mixed $padrao = null): mixed

Recupera um valor de configuração/estado do sistema com suporte a fallback e notação pontuada. Exemplo: gestor_get('usuario-id') ou gestor_get('banco.conexao.host', 'localhost')

Parameters

$chavestring
Chave simples ou caminho delimitado por pontos.
$padraomixed
Valor padrão retornado se a chave não existir.

Returns

mixed

gestor_set

view source · line 464 ↗
gestor_set(string $chave, mixed $valor): bool

Define ou atualiza um valor no estado global de forma segura e controlada. Se a chave for protegida/read-only, emite alerta no log e bloqueia mutação acidental.

Parameters

$chavestring
Chave simples ou caminho delimitado por pontos.
$valormixed
Valor a ser definido.

Returns

bool
True em caso de sucesso, false se bloqueado ou inválido.

gestor_has

view source · line 474 ↗
gestor_has(string $chave): bool

Verifica a existência de uma chave no estado global.

Parameters

$chavestring
Chave simples ou caminho delimitado por pontos.

Returns

bool

gestor_contexto

view source · line 484 ↗
gestor_contexto(string $escopo): array

Retorna uma fatia de contexto delimitada (ex.: dados do módulo ativo ou usuário ativo).

Parameters

$escopostring
Identificador do escopo ('modulo', 'usuario', 'sistema', etc.).

Returns

array

gestor_framework_css_resolver

view source · line 510 ↗
gestor_framework_css_resolver(string|null $layoutFramework = null, string|null $paginaFramework = null): array{fomantic:bool,tailwind:bool,modo:string}

Resolve o framework CSS efetivo de uma requisição a partir do layout E da página (req-118).

Parameters

$layoutFrameworkstring|null
Valor de layouts.framework_css.
$paginaFrameworkstring|null
Valor de paginas.framework_css.

Returns

array{fomantic:bool,tailwind:bool,modo:string}
modo é fomantic-ui, tailwindcss ou

gestor_schema_tabela_existe

view source · line 573 ↗
gestor_schema_tabela_existe(string $tabela): bool

Diz se uma tabela existe no banco corrente.

Parameters

$tabelastring
Nome da tabela.

Returns

bool
False também quando o banco não pôde ser consultado (falha fechado: sem certeza de

gestor_css_layouts_marcador

view source · line 738 ↗
gestor_css_layouts_marcador(array $layouts): string

Marcador gravado no início do CSS derivado de uma página compilada com mais de um layout.

Parameters

$layoutsarray
Ids dos layouts compilados junto.

Returns

string
Comentário CSS, ou string vazia quando não há layout.

gestor_css_layouts_cobertos

view source · line 757 ↗
gestor_css_layouts_cobertos(string $css): array

Layouts cobertos por um CSS derivado, lidos do marcador de gestor_css_layouts_marcador().

Parameters

$cssstring

Returns

array
Lista de ids; vazia quando o CSS não foi compilado com layouts.

gestor_pagina_recursos_incluir

view source · line 775 ↗
gestor_pagina_recursos_incluir(array $params = false)

Inclui recursos de página (CSS, CSS compilado e HTML extra head) no pipeline global. Controla duplicidades via hash MD5 para evitar inclusão redundante quando múltiplos blocos do mesmo widget/componente são inseridos na mesma página (req-028 / DEC-041).

Parameters

$paramsarray

gestor_crawler_detectar

view source · line 859 ↗
gestor_crawler_detectar(string|null $userAgent = null, $tokensExtra = null): bool

Detecta crawlers/scrapers sociais e de busca pelo User-Agent (req-109 / BATCH-109).

Parameters

$userAgentstring|null
User-Agent da requisição ($_SERVER['HTTP_USER_AGENT']).
$tokensExtra

Returns

bool

gestor_pagina_rota_sistema

view source · line 1015 ↗
gestor_pagina_rota_sistema(string $caminho = ''): bool

Identifica páginas de sistema que NÃO devem receber scripts de rastreamento (req-109 / BATCH-109).

Parameters

$caminhostring
Caminho da página já normalizado ($_GESTOR['caminho-total'] com barra final).

Returns

bool

gestor_site_acesso_restrito_perfil_autorizado

view source · line 1158 ↗
gestor_site_acesso_restrito_perfil_autorizado(string|int $perfilId, array $perfisAutorizados): bool

Decide se um perfil entra no site restrito (req-163).

Parameters

$perfilIdstring|int
id_usuarios_perfis do usuário autenticado.
$perfisAutorizadosarray
Saída de gestor_site_acesso_restrito_perfis().

Returns

bool

gestor_roteador_erro_terminal

view source · line 1176 ↗
gestor_roteador_erro_terminal(int|string $codigo, mixed $caminho = ''): bool

Detecta o fallback terminal da rota de erro para impedir redirecionamento 404 -> 404.

Parameters

$codigoint|string
Codigo HTTP em processamento.
$caminhomixed
Caminho atual recebido pelo roteador.

Returns

bool

gestor_roteador_pagina_status_http

view source · line 1188 ↗
gestor_roteador_pagina_status_http(mixed $caminho = ''): int|null

Retorna o status HTTP que deve ser preservado ao renderizar uma pagina de erro existente.

Parameters

$caminhomixed
Caminho da pagina encontrada pelo roteador.

Returns

int|null
Status HTTP explicito ou null para paginas comuns.

gestor_pagina_301_registrar

view source · line 1214 ↗
gestor_pagina_301_registrar(int|string $id_paginas, string $caminho): bool

Registra um redirecionamento 301 de um caminho liberado por uma página (F10 do review 2026-08-15).

Parameters

$id_paginasint|string
Id NUMÉRICO da página que liberou o caminho.
$caminhostring
Caminho antigo.

Returns

bool
True quando uma linha foi inserida.

gestor_open_graph_existe

view source · line 1466 ↗
gestor_open_graph_existe(string|array $html): bool

Detecta se um HTML já traz metatags OpenGraph próprias (req-109 / BATCH-109).

Parameters

$htmlstring|array
HTML (ou lista de trechos) já enfileirado para o <head>.

Returns

bool

gestor_pdf_viewer_assets

view source · line 1514 ↗
gestor_pdf_viewer_assets(string $urlRaiz = '', string $versao = ''): array

Tags de inclusão dos assets do motor PDF.js (req-096 / BATCH-096).

Parameters

$urlRaizstring
Raiz pública do projeto ($_GESTOR['url-raiz']).
$versaostring
Versão do sistema, usada para cache-bust.

Returns

array
Lista de tags <script>.

gestor_css_classes_usadas

view source · line 1533 ↗
gestor_css_classes_usadas(string $html): array

Classes efetivamente usadas no markup (BATCH-144 / req-141).

Parameters

$htmlstring
HTML da página ou do recurso.

Returns

array
Lista de classes distintas, sem repetição.

gestor_css_classes_descobertas

view source · line 1590 ↗
gestor_css_classes_descobertas(string $html, string $css): array

Classes que o HTML usa e nenhuma folha define (BATCH-144 / req-141).

Parameters

$htmlstring
HTML entregue.
$cssstring
CSS entregue.

Returns

array
Classes sem definição, em ordem estável.

gestor_css_classes_em_codigo

view source · line 1630 ↗
gestor_css_classes_em_codigo(string $codigo): array

Classes de estilo embutidas em código PHP/JS (BATCH-144 / req-141).

Parameters

$codigostring
Conteúdo de um arquivo PHP ou JS.

Returns

array
Classes distintas encontradas, em ordem estável.

gestor_css_procedencia_assinatura

view source · line 1709 ↗
gestor_css_procedencia_assinatura(array $params = false): string

Assinatura de procedência do CSS derivado (BATCH-144 / req-141 / CR-002).

Parameters

$paramsarray

Returns

string
Assinatura versionada, ou string vazia quando não há autoria nenhuma.

gestor_css_procedencia_para_recurso

view source · line 1783 ↗
gestor_css_procedencia_para_recurso(string $html, string $css, string $layout_id = '', string $tabela = 'paginas'): string

Par campo=valor da procedência, pronto para entrar num INSERT/UPDATE de recurso (req-141).

Parameters

$htmlstring
HTML autoral que está sendo gravado.
$cssstring
CSS autoral que está sendo gravado.
$layout_idstring
Layout do recurso; vazio para layouts (eles SÃO a base).
$tabelastring
Tabela de destino, para checar a coluna.

Returns

string
Assinatura, ou string vazia.

gestor_css_procedencia_valida

view source · line 1830 ↗
gestor_css_procedencia_valida(string $assinaturaGravada, array $params = false): bool

O CSS derivado corresponde à autoria vigente? (BATCH-144 / req-141)

Parameters

$assinaturaGravadastring
Valor da coluna css_source_hash.
$paramsarray
Mesmas entradas de gestor_css_procedencia_assinatura().

Returns

bool
true quando o derivado corresponde à autoria.

gestor_componente

view source · line 1876 ↗
gestor_componente(array|false $params = false): string|array|false

Renderiza um componente HTML/CSS dinâmico.

Parameters

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

Returns

string|array|false
HTML do componente ou array com HTML+CSS, ou false se não encontrado.

gestor_layout

view source · line 2108 ↗
gestor_layout(array|false $params = false): string|array|false

Renderiza um layout HTML/CSS completo da página.

Parameters

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

Returns

string|array|false
HTML do layout ou array com HTML+CSS, ou false se não encontrado.

gestor_variaveis

view source · line 2454 ↗
gestor_variaveis(array|false $params = false): string|array

Obtém variáveis do sistema por módulo e idioma.

Parameters

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

Returns

string|array
Valor da variável, array de variáveis (se conjunto), ou string vazia.

gestor_variaveis_globais

view source · line 2543 ↗
gestor_variaveis_globais(array|false $params = false): string|null

Obtém uma variável global específica do sistema.

Parameters

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

Returns

string|null
Valor da variável ou NULL se não encontrada.

gestor_csrf_destino_recarregamento

view source · line 2735 ↗
gestor_csrf_destino_recarregamento(string $caminhoTotal, string|null $referer, string $urlRaiz): string

Destino de recarregamento limpo para a tela de erro de CSRF (req-125 / BATCH-127).

Parameters

$caminhoTotalstring
Caminho da requisição corrente, já sem o prefixo de idioma.
$refererstring|null
Conteúdo de HTTP_REFERER, se houver.
$urlRaizstring
Raiz do gestor, com barra final e com idioma quando houver.

Returns

string
URL absoluta de destino ou '' quando indeterminado.

gestor_querystring_remover_variavel

view source · line 2832 ↗
gestor_querystring_remover_variavel(string $queryString, string $removerVariavel = ''): string

Remove uma variável específica da query string.

Parameters

$queryStringstring
Query string completa (formato: var1=val1&var2=val2).
$removerVariavelstring
Nome da variável a ser removida.

Returns

string
Query string processada sem a variável removida.

gestor_querystring_variavel

view source · line 2861 ↗
gestor_querystring_variavel(string $queryString, string $variavel = ''): string

Obtém o valor de uma variável específica da query string.

Parameters

$queryStringstring
Query string completa.
$variavelstring
Nome da variável a buscar.

Returns

string
Valor da variável ou string vazia se não encontrada.

gestor_querystring_before_submit

view source · line 2886 ↗
gestor_querystring_before_submit(string $fieldName = '_c2f_query_string_before_submit', string $default = ''): string

Recupera a query string antes do envio do formulário via campo hidden.

Parameters

$fieldNamestring
Nome do campo hidden enviado pelo formulário.
$defaultstring
Valor padrão se o campo não estiver definido.

Returns

string
Query string enviada no formulário, sem o "?" inicial.

gestor_querystring

view source · line 2909 ↗
gestor_querystring(string $removerVariavel = ''): string

Obtém a query string atual da requisição.

Parameters

$removerVariavelstring
Nome da variável adicional a remover (opcional).

Returns

string
Query string processada.

gestor_redirecionar

view source · line 2941 ↗
gestor_redirecionar(string|false $local = false, string $queryString = '', bool $externo = false): void

Redireciona para um local específico.

Parameters

$localstring|false
Caminho de destino (false = usar sessão ou raiz).
$queryStringstring
Query string adicional.
$externobool
Se true, trata como URL externa (não adiciona url-raiz).

Returns

void
(executa exit após redirecionar)

gestor_redirecionar_montar_url

view source · line 2981 ↗
gestor_redirecionar_montar_url(string $local, string $queryString = ''): string

Monta a URL de destino de um redirecionamento (req-173).

Parameters

$localstring
Destino já resolvido (interno ou externo).
$queryStringstring
Query string a anexar, com ou sem ?/& à frente.

Returns

string
URL final; sem query string, o destino sai intacto (nenhum ? órfão).

gestor_js_variavel_incluir

view source · line 3101 ↗
gestor_js_variavel_incluir(string $variavel, mixed $valor): void

Inclui uma variável JavaScript global na página.

Parameters

$variavelstring
Nome da variável JavaScript.
$valormixed
Valor da variável (será convertido para JSON).

Returns

void

gestor_sessao_variavel

view source · line 3419 ↗
gestor_sessao_variavel(string $variavel, mixed $valor = NULL): mixed

Obtém ou define uma variável de sessão.

Parameters

$variavelstring
Nome da variável de sessão.
$valormixed
Valor a ser armazenado (NULL para apenas leitura).

Returns

mixed
Valor da variável (em modo leitura) ou void (em modo escrita).

Controlled state, profile layouts and cookies

GestorState exposes gestor_get, gestor_set, gestor_has and gestor_contexto. Reads prefer a literal key, then resolve dot notation; writes block raiz-absoluta, url-raiz, linguagem-codigo and versao-num and record audit entries. This does not prevent direct superglobal assignment: it protects facade writes.

gestor_layouts_perfis_mapa normalizes JSON/object/array into a profile-to-layout map, discarding non-scalar or empty entries. gestor_css_layouts_marcador emits valid, unique, sorted IDs in a c2f-layouts comment; gestor_css_layouts_cobertos reads that marker from the first 2048 CSS bytes.

gestor_cookie_emitir uses setcookie in ordinary mode. Distributed mode requires secure transport and emits Path=/_distributed/, Secure, SameSite=None and Partitioned, with HttpOnly/Expires when requested.

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