From 51b4be69349f2f70e2171a94a1c62a19f01ed1a6 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 10 Mar 2023 18:57:32 +0700 Subject: [PATCH 1/8] Release 2.3.1-rc1 --- CHANGELOG.md | 23 +++++++++++++++++++++++ library/config.php | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a36a28d..975a4b03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Change Log +## [v2.3.1-rc1](https://github.com/torrentpier/torrentpier/tree/v2.3.1-rc1) (2023-03-10) +[Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.3.0.4-beta2...v2.3.1-rc1) + +**Merged pull requests:** + +- Minor adjustments in sql dumps [\#560](https://github.com/torrentpier/torrentpier/pull/560), [\#561](https://github.com/torrentpier/torrentpier/pull/561) ([belomaxorka](https://github.com/belomaxorka)) +- New BB_PATH implementation [\#562](https://github.com/torrentpier/torrentpier/pull/562) ([belomaxorka](https://github.com/belomaxorka)) +- Use constants instead of string literals [\#563](https://github.com/torrentpier/torrentpier/pull/563), [\#573](https://github.com/torrentpier/torrentpier/pull/573) ([belomaxorka](https://github.com/belomaxorka)) +- Hide feed button if feed file doesn't exist [\#564](https://github.com/torrentpier/torrentpier/pull/564) ([belomaxorka](https://github.com/belomaxorka)) +- Added some new fonts in bbcode editor [\#565](https://github.com/torrentpier/torrentpier/pull/565) ([belomaxorka](https://github.com/belomaxorka)) +- Added some new font sizes in bbcode editor [\#566](https://github.com/torrentpier/torrentpier/pull/566) ([belomaxorka](https://github.com/belomaxorka)) +- Added optional parameter in $valid_actions [AJAX] [\#567](https://github.com/torrentpier/torrentpier/pull/567) ([belomaxorka](https://github.com/belomaxorka)) +- Check if request is ajax [\#569](https://github.com/torrentpier/torrentpier/pull/569) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed code-style in some files [\#570](https://github.com/torrentpier/torrentpier/pull/570) ([belomaxorka](https://github.com/belomaxorka)) +- Minor adjustments [\#571](https://github.com/torrentpier/torrentpier/pull/571), [\#580](https://github.com/torrentpier/torrentpier/pull/580) ([belomaxorka](https://github.com/belomaxorka)) +- Added link to forum in admin_forumauth.tpl [\#574](https://github.com/torrentpier/torrentpier/pull/574) ([belomaxorka](https://github.com/belomaxorka)) +- Simplified make_rand_str function [\#575](https://github.com/torrentpier/torrentpier/pull/575) ([belomaxorka](https://github.com/belomaxorka)) +- Redesigned admin_ug_auth [\#576](https://github.com/torrentpier/torrentpier/pull/576) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed broken "user_viewonline" in admin panel [\#579](https://github.com/torrentpier/torrentpier/pull/579) ([belomaxorka](https://github.com/belomaxorka)) +- Make sitemap sending configurable [\#585](https://github.com/torrentpier/torrentpier/pull/585) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed get_avatar method [\#586](https://github.com/torrentpier/torrentpier/pull/586) ([belomaxorka](https://github.com/belomaxorka)) +- Added show avatar in memberlist [\#587](https://github.com/torrentpier/torrentpier/pull/587) ([belomaxorka](https://github.com/belomaxorka)) + ## [v2.3.0.4-beta2](https://github.com/torrentpier/torrentpier/tree/v2.3.0.4-beta2) (2023-03-04) [Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.3.0.4-beta...v2.3.0.4-beta2) diff --git a/library/config.php b/library/config.php index 1143c6ac3..1e113d474 100644 --- a/library/config.php +++ b/library/config.php @@ -21,8 +21,8 @@ $bb_cfg = []; $bb_cfg['js_ver'] = $bb_cfg['css_ver'] = 1; // Version info -$bb_cfg['tp_version'] = '2.3.0.4-beta2'; -$bb_cfg['tp_release_date'] = '04-03-2023'; +$bb_cfg['tp_version'] = '2.3.1-rc1'; +$bb_cfg['tp_release_date'] = '10-03-2023'; $bb_cfg['tp_release_codename'] = 'Bison'; // Database From 0f08b4ea41969f20d4d0e5527c6bbfa387fc922e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 11 Mar 2023 08:53:04 +0700 Subject: [PATCH 2/8] changelog: fixed incorrect PR number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 975a4b03e..92ff4a7a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - Added optional parameter in $valid_actions [AJAX] [\#567](https://github.com/torrentpier/torrentpier/pull/567) ([belomaxorka](https://github.com/belomaxorka)) - Check if request is ajax [\#569](https://github.com/torrentpier/torrentpier/pull/569) ([belomaxorka](https://github.com/belomaxorka)) - Fixed code-style in some files [\#570](https://github.com/torrentpier/torrentpier/pull/570) ([belomaxorka](https://github.com/belomaxorka)) -- Minor adjustments [\#571](https://github.com/torrentpier/torrentpier/pull/571), [\#580](https://github.com/torrentpier/torrentpier/pull/580) ([belomaxorka](https://github.com/belomaxorka)) +- Minor adjustments [\#571](https://github.com/torrentpier/torrentpier/pull/571), [\#584](https://github.com/torrentpier/torrentpier/pull/584) ([belomaxorka](https://github.com/belomaxorka)) - Added link to forum in admin_forumauth.tpl [\#574](https://github.com/torrentpier/torrentpier/pull/574) ([belomaxorka](https://github.com/belomaxorka)) - Simplified make_rand_str function [\#575](https://github.com/torrentpier/torrentpier/pull/575) ([belomaxorka](https://github.com/belomaxorka)) - Redesigned admin_ug_auth [\#576](https://github.com/torrentpier/torrentpier/pull/576) ([belomaxorka](https://github.com/belomaxorka)) From e1fb41e55834e7a6719a64f1548cffa2cc8ba86b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 14 Mar 2023 12:49:49 +0700 Subject: [PATCH 3/8] Make activate key lenght configurable --- library/includes/init_bb.php | 3 ++- library/includes/ucp/register.php | 4 ++-- library/includes/ucp/sendpasswd.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 825ae4da0..f570cba32 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -274,8 +274,9 @@ define('SHOW_PEERS_NAMES', 2); define('SHOW_PEERS_FULL', 3); define('SEARCH_ID_LENGTH', 12); +define('ACTKEY_LENGHT', 32); define('SID_LENGTH', 20); -define('LOGIN_KEY_LENGTH', 12); +define('LOGIN_KEY_LENGTH', 32); define('USERNAME_MAX_LENGTH', 25); define('USEREMAIL_MAX_LENGTH', 40); diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index 28bb73688..4a51d15f9 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -535,7 +535,7 @@ if ($submit && !$errors) { */ if ($mode == 'register') { if ($bb_cfg['reg_email_activation']) { - $user_actkey = make_rand_str(12); + $user_actkey = make_rand_str(ACTKEY_LENGHT); $db_data['user_active'] = 0; $db_data['user_actkey'] = $user_actkey; } else { @@ -600,7 +600,7 @@ if ($submit && !$errors) { // если что-то было изменено if ($db_data) { if (!$pr_data['user_active']) { - $user_actkey = make_rand_str(12); + $user_actkey = make_rand_str(ACTKEY_LENGHT); $pr_data['user_actkey'] = $user_actkey; $db_data['user_actkey'] = $user_actkey; diff --git a/library/includes/ucp/sendpasswd.php b/library/includes/ucp/sendpasswd.php index e170c2dd3..2d8cd54a0 100644 --- a/library/includes/ucp/sendpasswd.php +++ b/library/includes/ucp/sendpasswd.php @@ -37,7 +37,7 @@ if (isset($_POST['submit'])) { $username = $row['username']; $user_id = $row['user_id']; - $user_actkey = make_rand_str(12); + $user_actkey = make_rand_str(ACTKEY_LENGHT); $user_password = make_rand_str(8); $sql = "UPDATE " . BB_USERS . " From 7585dcbcea190f0612ea35ae29623ee849d781d0 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 15 Mar 2023 15:31:39 +0700 Subject: [PATCH 4/8] Minor adjustments #592 * Minor adjustments for future. --- library/includes/init_bb.php | 5 +++-- library/includes/ucp/sendpasswd.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index f570cba32..b8ea9ef9c 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -159,8 +159,6 @@ define('PRIVMSGS_UNREAD_MAIL', 5); define('HAVE_UNREAD_PM', 1); define('HAVE_NEW_PM', 2); -define('USERNAME_MIN_LENGTH', 3); - // URL PARAMETERS (hardcoding allowed) define('POST_CAT_URL', 'c'); define('POST_FORUM_URL', 'f'); @@ -277,8 +275,11 @@ define('SEARCH_ID_LENGTH', 12); define('ACTKEY_LENGHT', 32); define('SID_LENGTH', 20); define('LOGIN_KEY_LENGTH', 32); +define('USERNAME_MIN_LENGTH', 3); define('USERNAME_MAX_LENGTH', 25); define('USEREMAIL_MAX_LENGTH', 40); +define('PASSWORD_MIN_LENGTH', 8); +define('PASSWORD_MAX_LENGTH', 24); define('PAGE_HEADER', INC_DIR . '/page_header.php'); define('PAGE_FOOTER', INC_DIR . '/page_footer.php'); diff --git a/library/includes/ucp/sendpasswd.php b/library/includes/ucp/sendpasswd.php index 2d8cd54a0..1d4589edb 100644 --- a/library/includes/ucp/sendpasswd.php +++ b/library/includes/ucp/sendpasswd.php @@ -38,7 +38,7 @@ if (isset($_POST['submit'])) { $user_id = $row['user_id']; $user_actkey = make_rand_str(ACTKEY_LENGHT); - $user_password = make_rand_str(8); + $user_password = make_rand_str(PASSWORD_MIN_LENGTH); $sql = "UPDATE " . BB_USERS . " SET user_newpasswd = '$user_password', user_actkey = '$user_actkey' From 2d86843f96be9cc05c2ee6366d4650534a5fbecc Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 15 Mar 2023 23:39:14 +0700 Subject: [PATCH 5/8] Fixed typo in src/Cache/File.php cache->set('$name') -> cache->get('$name'). --- src/Legacy/Cache/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Legacy/Cache/File.php b/src/Legacy/Cache/File.php index c7e5ea857..5030e8519 100644 --- a/src/Legacy/Cache/File.php +++ b/src/Legacy/Cache/File.php @@ -31,7 +31,7 @@ class File extends Common { $filename = $this->dir . clean_filename($this->prefix . $name) . '.php'; - $this->cur_query = "cache->set('$name')"; + $this->cur_query = "cache->get('$name')"; $this->debug('start'); if (file_exists($filename)) { From 25bc51eebbb21d33a42dff447867653c6a989323 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 16 Mar 2023 14:23:32 +0700 Subject: [PATCH 6/8] Removed ENV --- .env.example | 12 -------- common.php | 50 +++---------------------------- composer.json | 1 - composer.lock | 73 ++-------------------------------------------- library/config.php | 9 +----- 5 files changed, 7 insertions(+), 138 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index dd55a2a6e..000000000 --- a/.env.example +++ /dev/null @@ -1,12 +0,0 @@ -# Common params -APP_NAME=TorrentPier -APP_ENV=local -APP_DEBUG=false - -# Database credentials -DB_CONNECTION=mysql -DB_HOST=localhost -DB_PORT=3306 -DB_DATABASE=torrentpier -DB_USERNAME=root -DB_PASSWORD=secret diff --git a/common.php b/common.php index 8c4b6d479..ef02e04e8 100644 --- a/common.php +++ b/common.php @@ -50,50 +50,10 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) { } require_once __DIR__ . '/vendor/autoload.php'; -/** - * Gets the value of an environment variable. Supports boolean, empty and null. - * - * @param string $key - * @param mixed $default - * @return mixed - */ -function env($key, $default = null) -{ - $value = getenv($key); - if (!$value) return value($default); - switch (strtolower($value)) { - case 'true': - case '(true)': - return true; - case 'false': - case '(false)': - return false; - case '(null)': - return null; - case '(empty)': - return ''; - } - return $value; -} - -/** - * Return the default value of the given value. - * - * @param mixed $value - * @return mixed - */ -function value($value) -{ - return $value instanceof Closure ? $value() : $value; -} - // Get initial config -if (!getenv('APP_DEBUG') && file_exists(__DIR__ . '/.env')) { - (new Symfony\Component\Dotenv\Dotenv())->load(__DIR__ . '/.env'); -} require_once __DIR__ . '/library/config.php'; -// Local config +// Get local config if (file_exists(__DIR__ . '/library/config.local.php')) { require_once __DIR__ . '/library/config.local.php'; } @@ -136,11 +96,9 @@ define('BOT_UID', -746); * Progressive error reporting */ if ($bb_cfg['bugsnag']['enabled']) { - if (env('APP_ENV', 'production') !== 'local') { - /** @var Bugsnag\Handler $bugsnag */ - $bugsnag = Bugsnag\Client::make($bb_cfg['bugsnag']['api_key']); - Bugsnag\Handler::register($bugsnag); - } + /** @var Bugsnag\Handler $bugsnag */ + $bugsnag = Bugsnag\Client::make($bb_cfg['bugsnag']['api_key']); + Bugsnag\Handler::register($bugsnag); } else { if (DBG_USER) { /** @var Whoops\Run $whoops */ diff --git a/composer.json b/composer.json index f20bac1f0..2c6b1430e 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,6 @@ "rych/bencode": "v1.0.0", "samdark/sitemap": "2.4.0", "swiftmailer/swiftmailer": "v6.3.0", - "symfony/dotenv": "4.*", "symfony/polyfill": "v1.27.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index a7ec7e232..5bc745750 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "530818326ea7baa3a459b76781f0157a", + "content-hash": "2ac8346651466f89508650fddb2461db", "packages": [ { "name": "bugsnag/bugsnag", @@ -1173,75 +1173,6 @@ "abandoned": "symfony/mailer", "time": "2021-10-18T15:26:12+00:00" }, - { - "name": "symfony/dotenv", - "version": "v4.4.37", - "source": { - "type": "git", - "url": "https://github.com/symfony/dotenv.git", - "reference": "fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf", - "reference": "fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf", - "shasum": "" - }, - "require": { - "php": ">=7.1.3" - }, - "require-dev": { - "symfony/process": "^3.4.2|^4.0|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Dotenv\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Registers environment variables from a .env file", - "homepage": "https://symfony.com", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "source": "https://github.com/symfony/dotenv/tree/v4.4.37" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:41:36+00:00" - }, { "name": "symfony/polyfill", "version": "v1.27.0", @@ -1460,5 +1391,5 @@ "php": "^7.1.3" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/library/config.php b/library/config.php index 1e113d474..1fe4940ec 100644 --- a/library/config.php +++ b/library/config.php @@ -29,14 +29,7 @@ $bb_cfg['tp_release_codename'] = 'Bison'; // Настройка баз данных ['db']['srv_name'] => (array) srv_cfg; // порядок параметров srv_cfg (хост, название базы, пользователь, пароль, charset, pconnect); $bb_cfg['db'] = [ - 'db' => [ - env('DB_HOST', 'localhost'), - env('DB_DATABASE', 'torrentpier'), - env('DB_USERNAME', 'root'), - env('DB_PASSWORD', 'pass'), - 'utf8', - false - ], + 'db' => ['localhost', 'torrentpier', 'root', 'root', 'utf8', false], ]; $bb_cfg['db_alias'] = [ From 1f75f4e997c66b67c2412c889a9025712b8b268d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Thu, 16 Mar 2023 07:23:51 +0000 Subject: [PATCH 7/8] Apply fixes from StyleCI --- src/Legacy/Ajax.php | 8 ++++---- src/Legacy/Torrent.php | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Legacy/Ajax.php b/src/Legacy/Ajax.php index f779a72da..42a4d0aad 100644 --- a/src/Legacy/Ajax.php +++ b/src/Legacy/Ajax.php @@ -101,14 +101,14 @@ class Ajax case 'guest': break; - // USER + // USER case 'user': if (IS_GUEST) { $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } break; - // MOD + // MOD case 'mod': if (!IS_AM) { $this->ajax_die($lang['ONLY_FOR_MOD']); @@ -116,7 +116,7 @@ class Ajax $this->check_admin_session(); break; - // ADMIN + // ADMIN case 'admin': if (!IS_ADMIN) { $this->ajax_die($lang['ONLY_FOR_ADMIN']); @@ -124,7 +124,7 @@ class Ajax $this->check_admin_session(); break; - // SUPER_ADMIN + // SUPER_ADMIN case 'super_admin': if (!IS_SUPER_ADMIN) { $this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']); diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index bdbdee9ec..e7eb33b17 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -719,7 +719,6 @@ class Torrent $attempts = $success = $response = 0; while (!$success && $attempts++ < $max_attempts) { - // Send request $file = fsockopen($bb_cfg['ocelot']['host'], $bb_cfg['ocelot']['port'], $error_num, $error_string); if ($file) { From f8722a8b9a23e4779737f53528d44a4ccd09223e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 16 Mar 2023 14:33:37 +0700 Subject: [PATCH 8/8] Revert "Removed ENV" --- .env.example | 12 ++++++++ common.php | 50 ++++++++++++++++++++++++++++--- composer.json | 1 + composer.lock | 73 ++++++++++++++++++++++++++++++++++++++++++++-- library/config.php | 9 +++++- 5 files changed, 138 insertions(+), 7 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..dd55a2a6e --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +# Common params +APP_NAME=TorrentPier +APP_ENV=local +APP_DEBUG=false + +# Database credentials +DB_CONNECTION=mysql +DB_HOST=localhost +DB_PORT=3306 +DB_DATABASE=torrentpier +DB_USERNAME=root +DB_PASSWORD=secret diff --git a/common.php b/common.php index ef02e04e8..8c4b6d479 100644 --- a/common.php +++ b/common.php @@ -50,10 +50,50 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) { } require_once __DIR__ . '/vendor/autoload.php'; +/** + * Gets the value of an environment variable. Supports boolean, empty and null. + * + * @param string $key + * @param mixed $default + * @return mixed + */ +function env($key, $default = null) +{ + $value = getenv($key); + if (!$value) return value($default); + switch (strtolower($value)) { + case 'true': + case '(true)': + return true; + case 'false': + case '(false)': + return false; + case '(null)': + return null; + case '(empty)': + return ''; + } + return $value; +} + +/** + * Return the default value of the given value. + * + * @param mixed $value + * @return mixed + */ +function value($value) +{ + return $value instanceof Closure ? $value() : $value; +} + // Get initial config +if (!getenv('APP_DEBUG') && file_exists(__DIR__ . '/.env')) { + (new Symfony\Component\Dotenv\Dotenv())->load(__DIR__ . '/.env'); +} require_once __DIR__ . '/library/config.php'; -// Get local config +// Local config if (file_exists(__DIR__ . '/library/config.local.php')) { require_once __DIR__ . '/library/config.local.php'; } @@ -96,9 +136,11 @@ define('BOT_UID', -746); * Progressive error reporting */ if ($bb_cfg['bugsnag']['enabled']) { - /** @var Bugsnag\Handler $bugsnag */ - $bugsnag = Bugsnag\Client::make($bb_cfg['bugsnag']['api_key']); - Bugsnag\Handler::register($bugsnag); + if (env('APP_ENV', 'production') !== 'local') { + /** @var Bugsnag\Handler $bugsnag */ + $bugsnag = Bugsnag\Client::make($bb_cfg['bugsnag']['api_key']); + Bugsnag\Handler::register($bugsnag); + } } else { if (DBG_USER) { /** @var Whoops\Run $whoops */ diff --git a/composer.json b/composer.json index 2c6b1430e..f20bac1f0 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "rych/bencode": "v1.0.0", "samdark/sitemap": "2.4.0", "swiftmailer/swiftmailer": "v6.3.0", + "symfony/dotenv": "4.*", "symfony/polyfill": "v1.27.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 5bc745750..a7ec7e232 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2ac8346651466f89508650fddb2461db", + "content-hash": "530818326ea7baa3a459b76781f0157a", "packages": [ { "name": "bugsnag/bugsnag", @@ -1173,6 +1173,75 @@ "abandoned": "symfony/mailer", "time": "2021-10-18T15:26:12+00:00" }, + { + "name": "symfony/dotenv", + "version": "v4.4.37", + "source": { + "type": "git", + "url": "https://github.com/symfony/dotenv.git", + "reference": "fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf", + "reference": "fcedd6d382b3afc3e1e786aa4e4fc4cf06f564cf", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "require-dev": { + "symfony/process": "^3.4.2|^4.0|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Dotenv\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Registers environment variables from a .env file", + "homepage": "https://symfony.com", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "source": "https://github.com/symfony/dotenv/tree/v4.4.37" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:41:36+00:00" + }, { "name": "symfony/polyfill", "version": "v1.27.0", @@ -1391,5 +1460,5 @@ "php": "^7.1.3" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/library/config.php b/library/config.php index 1fe4940ec..1e113d474 100644 --- a/library/config.php +++ b/library/config.php @@ -29,7 +29,14 @@ $bb_cfg['tp_release_codename'] = 'Bison'; // Настройка баз данных ['db']['srv_name'] => (array) srv_cfg; // порядок параметров srv_cfg (хост, название базы, пользователь, пароль, charset, pconnect); $bb_cfg['db'] = [ - 'db' => ['localhost', 'torrentpier', 'root', 'root', 'utf8', false], + 'db' => [ + env('DB_HOST', 'localhost'), + env('DB_DATABASE', 'torrentpier'), + env('DB_USERNAME', 'root'), + env('DB_PASSWORD', 'pass'), + 'utf8', + false + ], ]; $bb_cfg['db_alias'] = [