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
-
The module JSON declares the list in
bibliotecas:
{ "versao": "1.0.4", "bibliotecas": ["interface", "html", "html-editor"] }-
The module controller reads its JSON into
$_GESTOR['modulo#<id>']and, in its<module>_start()function, callsgestor_incluir_bibliotecas(), which runsrequire_onceon each registered file and records the name in$_GESTOR['bibliotecas-inseridas']. -
In standalone code (widgets, controllers, routines), use
gestor_incluir_biblioteca('name')orgestor_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.