Minor improvements (#1730)

* Minor improvements

* Updated

* Updated

* Update common.php

* Update common.php

* Updated

* Revert "Updated"

This reverts commit 204d196ba5.

* Revert "Update common.php"

This reverts commit eb24dc1c85.

* Updated

* Updated

* Update build_check_updates.php

* Update build_check_updates.php

* Update common.php

* Update build_check_updates.php

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2025-01-01 20:52:34 +07:00 committed by GitHub
commit 768837608b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 119 additions and 71 deletions

View file

@ -87,9 +87,10 @@ if (is_file(BB_PATH . '/library/config.local.php')) {
}
/**
* Error reporting
* Initialize debug
*/
if (env('APP_ENV') === 'local') {
define('APP_ENV', env('APP_ENV', 'production'));
if (APP_ENV === 'local') {
define('DBG_USER', true); // forced debug
} else {
define('DBG_USER', isset($_COOKIE[COOKIE_DBG]));
@ -347,26 +348,12 @@ function sys(string $param)
}
}
/**
* Returns version code
*
* @param string $version
* @return int
*/
function version_code(string $version): int
{
return (int)trim(str_replace(['.', 'v'], '', $version));
}
/**
* Some shared defines
*/
// Initialize demo mode
define('IN_DEMO_MODE', env('APP_DEMO_MODE', false));
// Version code
define('VERSION_CODE', version_code($bb_cfg['tp_version']));
// Ratio status
define('RATIO_ENABLED', TR_RATING_LIMITS && MIN_DL_FOR_RATIO > 0);