mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor improvements (#1730)
* Minor improvements * Updated * Updated * Update common.php * Update common.php * Updated * Revert "Updated" This reverts commit204d196ba5
. * Revert "Update common.php" This reverts commiteb24dc1c85
. * 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:
parent
4a076a09cc
commit
768837608b
9 changed files with 119 additions and 71 deletions
19
common.php
19
common.php
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue