Conn2Flow
Docs navigation

Reference / Libraries

Gestor libraries

How the libraries in gestor/bibliotecas/ are registered and loaded, which ones are always loaded and how a module requests its own.

Libraries are procedural PHP files in gestor/bibliotecas/, each grouping functions under the same prefix (banco_*, modelo_*, interface_*…). There is no autoload and no namespace: they are loaded with require_once from a central registry.

The registry: $_GESTOR['bibliotecas-dados']

In gestor/config.php, each logical name points to one or more files:

$_GESTOR['bibliotecas-dados'] = Array(
    'banco'   => Array('banco.php'),
    'gestor'  => Array('gestor.php'),
    'modelo'  => Array('modelo.php'),
    // ...
    'cron'    => Array('cron.php'),
);

Modules and functions request a library by its logical name, not by file.

What is always loaded

config.php always loads banco, gestor, modelo and hooks (the $_GESTOR['bibliotecas'] list). Anywhere in the Gestor, functions such as banco_select(), gestor_variaveis(), modelo_var_troca() and hook_do_action() are available.

How a module requests libraries

  1. The module JSON declares the list in bibliotecas:

{ "versao": "1.0.4", "bibliotecas": ["interface", "html", "html-editor"] }
  1. The module controller reads its JSON into $_GESTOR['modulo#<id>'] and, in its <module>_start() function, calls gestor_incluir_bibliotecas(), which runs require_once on each registered file and records the name in $_GESTOR['bibliotecas-inseridas'].

  2. In standalone code (widgets, controllers, routines), use gestor_incluir_biblioteca('name') or gestor_incluir_biblioteca(['a', 'b']), which skips what is already included.

Libraries may also have their own AJAX routines: interface.php forwards interface AJAX requests to html_editor_ajax_interface() when html-editor is among the Gestor's or the module's libraries.

cron.php runs outside the module lifecycle and therefore includes its libraries directly instead of using gestor_incluir_bibliotecas().

Reference per library

Each library has a page with the function list generated from the code (c2f docs:extract) and an explanation of its actual behavior. See the "Reference → Libraries" menu.

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