refactor: update legacy files to maintain compatibility with bb_cfg deprecation

- Added comments in init_bb.php, Template.php, and Cron.php to indicate that bb_cfg is deprecated but retained for compatibility with non-adapted code.
- Ensured clarity in documentation for future reference while transitioning to the new configuration system.

Files modified:
- init_bb.php
- Template.php
- Cron.php
This commit is contained in:
Yury Pikhtarev 2025-06-18 01:16:54 +04:00
commit 6fdfa8d17f
No known key found for this signature in database
3 changed files with 4 additions and 1 deletions

View file

@ -375,6 +375,7 @@ function make_url(string $path = ''): string
require_once INC_DIR . '/functions.php';
// Merge database configuration with base configuration using singleton
// bb_cfg deprecated, but kept for compatibility with non-adapted code
config()->merge(bb_get_config(BB_CONFIG));
$bb_cfg = config()->all();

View file

@ -23,6 +23,7 @@ class Cron
public static function run_jobs(string $jobs): void
{
/** @noinspection PhpUnusedLocalVariableInspection */
// bb_cfg deprecated, but kept for compatibility with non-adapted cron jobs
global $bb_cfg, $datastore;
\define('IN_CRON', true);

View file

@ -17,7 +17,7 @@ class Template
{
/**
* Variable that holds all the data we'll be substituting into the compiled templates.
* This will end up being a multi-dimensional array like this:
* This will end up being a multidimensional array like this:
* $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value
* if it's a root-level variable, it'll be like this:
* $this->vars[varname] == value or $this->_tpldata['.'][0][varname] == value
@ -228,6 +228,7 @@ class Template
{
$this->cur_tpl = $filename;
/** @noinspection PhpUnusedLocalVariableInspection */
// bb_cfg deprecated, but kept for compatibility with non-adapted themes
global $lang, $source_lang, $bb_cfg, $user;