From df9922870cb6e1546a2a11547b3fa9a41e59d73b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 11 Aug 2024 16:07:05 +0700 Subject: [PATCH] Minor improvements (#1589) * Minor improvements * Update CHANGELOG.md * Update README.md --- CHANGELOG.md | 2 +- README.md | 11 ++++++----- common.php | 23 ----------------------- library/defines.php | 15 --------------- src/Helpers/IsHelper.php | 11 ----------- 5 files changed, 7 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 790b67536..0c59986fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka)) - Fixed `md5()` deprecated in PHP 8.4 [\#1561](https://github.com/torrentpier/torrentpier/pull/1561) ([belomaxorka](https://github.com/belomaxorka)) - Increased `USEREMAIL_MAX_LENGTH` [\#1566](https://github.com/torrentpier/torrentpier/pull/1566) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1570](https://github.com/torrentpier/torrentpier/pull/1570), [\#1571](https://github.com/torrentpier/torrentpier/pull/1571), [\#1575](https://github.com/torrentpier/torrentpier/pull/1575) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1570](https://github.com/torrentpier/torrentpier/pull/1570), [\#1571](https://github.com/torrentpier/torrentpier/pull/1571), [\#1575](https://github.com/torrentpier/torrentpier/pull/1575), [\#1589](https://github.com/torrentpier/torrentpier/pull/1589) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1569](https://github.com/torrentpier/torrentpier/pull/1569), [\#1572](https://github.com/torrentpier/torrentpier/pull/1572), [\#1573](https://github.com/torrentpier/torrentpier/pull/1573), [\#1574](https://github.com/torrentpier/torrentpier/pull/1574), [\#1588](https://github.com/torrentpier/torrentpier/pull/1588) ([Exileum](https://github.com/Exileum)) ## [v2.4.4](https://github.com/torrentpier/torrentpier/tree/v2.4.4) (2024-07-22) diff --git a/README.md b/README.md index 54b8656c8..1a1e4e88f 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,15 @@ For installation, you need to follow a few simple steps. 1. Install [Composer](https://getcomposer.org/) 2. Run `composer create-project torrentpier/torrentpier` -3. After run `composer install` on the project directory -4. Create database and import dump located at `install/sql/mysql.sql` -5. Edit database configuration settings in the environment (`.env.example`, after rename to `.env`) -6. Provide write permissions to the specified folders: +3. [Check our system requirements](#-requirements) +4. After run `composer install` on the project directory +5. Create database and import dump located at `install/sql/mysql.sql` +6. Edit database configuration settings in the environment (`.env.example`), after rename to `.env` +7. Provide write permissions to the specified folders: * `data/avatars`, `data/uploads`, `data/uploads/thumbs` * `internal_data/atom`, `internal_data/cache`, `internal_data/log`, `internal_data/triggers` * `sitemap` -7. Voila! ✨ +8. Voila! ✨ > [!IMPORTANT] > The specific settings depend on the server you are using, but in general case we recommend chmod **0755** for folders, and chmod **0644** for files in them. diff --git a/common.php b/common.php index b50e65ea8..47c39eb68 100644 --- a/common.php +++ b/common.php @@ -143,29 +143,6 @@ switch ($bb_cfg['datastore_type']) { $datastore = new TorrentPier\Legacy\Datastore\File($bb_cfg['cache']['db_dir'] . 'datastore/', $bb_cfg['cache']['prefix']); } -/** - * Check system requirements - */ -if (CHECK_REQUIREMENTS['status'] && !CACHE('bb_cache')->get('system_req')) { - // [1] Check PHP Version - if (!\TorrentPier\Helpers\IsHelper::isPHP(CHECK_REQUIREMENTS['php_min_version'])) { - die("TorrentPier requires PHP version " . CHECK_REQUIREMENTS['php_min_version'] . "+ Your PHP version " . PHP_VERSION); - } - - // [2] Check installed PHP Extensions on server - $data = []; - foreach (CHECK_REQUIREMENTS['ext_list'] as $ext) { - if (!extension_loaded($ext)) { - $data[] = '' . $ext . ''; - } - } - if (!empty($data)) { - die(sprintf("TorrentPier requires %s extension(s) installed on server", implode(', ', $data))); - } - - CACHE('bb_cache')->set('system_req', true); -} - // Functions function utime() { diff --git a/library/defines.php b/library/defines.php index 7f4bd47ad..48c2d18ca 100644 --- a/library/defines.php +++ b/library/defines.php @@ -35,21 +35,6 @@ define('UPDATER_FILE', INT_DATA_DIR . '/updater.json'); define('API_IP_URL', 'https://freeipapi.com/api/json/'); define('CHECKSUMS_FILE', INT_DATA_DIR . '/checksums.md5'); define('RESTORE_CORRUPT_CONFIRM_FILE', INT_DATA_DIR . '/rescorrupt.integrity'); -define('CHECK_REQUIREMENTS', [ - 'status' => true, - 'php_min_version' => '8.1.0', - 'ext_list' => [ - 'json', - 'curl', - 'mysqli', - 'bcmath', - 'mbstring', - 'intl', - 'xml', - 'xmlwriter', - 'zip' - ], -]); // Templates define('ADMIN_TPL_DIR', TEMPLATES_DIR . '/admin/'); diff --git a/src/Helpers/IsHelper.php b/src/Helpers/IsHelper.php index ec10f387f..87cd3ecb8 100644 --- a/src/Helpers/IsHelper.php +++ b/src/Helpers/IsHelper.php @@ -15,17 +15,6 @@ namespace TorrentPier\Helpers; */ class IsHelper { - /** - * Determines if the current version of PHP is equal to or greater than the supplied value - * - * @param string $version - * @return bool TRUE if the current version is $version or higher - */ - public static function isPHP(string $version): bool - { - return version_compare(PHP_VERSION, $version, '>='); - } - /** * Return true if server have SSL *