mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor improvements (#1676)
* Minor improvements * Update functions.php * Update common.php * Update init_bb.php * Updated * Update build_files_integrity.php * Updated * Update CHANGELOG.md * Update legacy-changes.txt * Update legacy-changes.txt * Update legacy-changes.txt * Update .gitignore * Update legacy-changes.txt
This commit is contained in:
parent
e1f03e64dd
commit
4dcee993cc
9 changed files with 55 additions and 94 deletions
24
common.php
24
common.php
|
@ -324,6 +324,12 @@ function hide_bb_path(string $path): string
|
|||
return ltrim(str_replace(BB_PATH, '', $path), '/\\');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns memory usage statistic
|
||||
*
|
||||
* @param string $param
|
||||
* @return int|void
|
||||
*/
|
||||
function sys(string $param)
|
||||
{
|
||||
switch ($param) {
|
||||
|
@ -336,9 +342,27 @@ 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);
|
||||
|
||||
// Initialization
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue