From b284ff0f08be0c9e6d02db39a75ff76973cc5ff7 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 14 Dec 2023 18:57:58 +0700 Subject: [PATCH] Minor improvements (#1206) --- admin/stats/tr_stats.php | 2 +- admin/stats/tracker.php | 2 +- composer.json | 5 +- composer.lock | 493 +++++++++++++++++++++++++++---- library/includes/page_footer.php | 4 +- 5 files changed, 442 insertions(+), 64 deletions(-) diff --git a/admin/stats/tr_stats.php b/admin/stats/tr_stats.php index c81c752a7..6cd8eea56 100644 --- a/admin/stats/tr_stats.php +++ b/admin/stats/tr_stats.php @@ -38,7 +38,7 @@ foreach ($sql as $i => $query) { echo ''; echo '
';
 
-echo 'gen time: ' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n";
+echo 'gen time: ' . sprintf('%.4f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n";
 
 echo '
'; echo ''; diff --git a/admin/stats/tracker.php b/admin/stats/tracker.php index 9fcbc2ec4..98fd99f32 100644 --- a/admin/stats/tracker.php +++ b/admin/stats/tracker.php @@ -174,7 +174,7 @@ echo ''; echo !$client_full ? '

Simple stats for clients are being cached for one hour.

' : ''; echo '
';
 
-echo 'gen time: ' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n";
+echo 'gen time: ' . sprintf('%.4f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n";
 echo '
'; echo ''; diff --git a/composer.json b/composer.json index cf05f7c65..889cfe011 100644 --- a/composer.json +++ b/composer.json @@ -43,14 +43,11 @@ "filp/whoops": "^2.15", "gigablah/sphinxphp": "2.0.8", "google/recaptcha": "^1.3", - "guzzlehttp/guzzle": "^7.8", - "guzzlehttp/psr7": "^2.6", "josantonius/cookie": "^2.0", "longman/ip-tools": "1.2.1", "monolog/monolog": "^3.4", "samdark/sitemap": "2.4.1", "symfony/mailer": "^6.3", - "symfony/polyfill": "v1.28.0", "vlucas/phpdotenv": "^5.5" }, "require-dev": { @@ -63,7 +60,7 @@ }, "config": { "sort-packages": true, - "optimize-autoloader": false + "optimize-autoloader": true }, "minimum-stability": "stable", "prefer-stable": true diff --git a/composer.lock b/composer.lock index 7e3fcbec4..3692524c5 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": "bfcbfff44a7b82ebbac0fe610dfba0d4", + "content-hash": "1579104ffbdcad0fe85f622bb946ca2d", "packages": [ { "name": "arokettu/bencode", @@ -2088,75 +2088,213 @@ "time": "2023-10-17T11:49:05+00:00" }, { - "name": "symfony/polyfill", + "name": "symfony/polyfill-ctype", "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill.git", - "reference": "33def419104fb3cf14be4e8638683eb9845c2522" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill/zipball/33def419104fb3cf14be4e8638683eb9845c2522", - "reference": "33def419104fb3cf14be4e8638683eb9845c2522", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { "php": ">=7.1" }, - "replace": { - "symfony/polyfill-apcu": "self.version", - "symfony/polyfill-ctype": "self.version", - "symfony/polyfill-iconv": "self.version", - "symfony/polyfill-intl-grapheme": "self.version", - "symfony/polyfill-intl-icu": "self.version", - "symfony/polyfill-intl-idn": "self.version", - "symfony/polyfill-intl-messageformatter": "self.version", - "symfony/polyfill-intl-normalizer": "self.version", - "symfony/polyfill-mbstring": "self.version", - "symfony/polyfill-php72": "self.version", - "symfony/polyfill-php73": "self.version", - "symfony/polyfill-php74": "self.version", - "symfony/polyfill-php80": "self.version", - "symfony/polyfill-php81": "self.version", - "symfony/polyfill-php82": "self.version", - "symfony/polyfill-php83": "self.version", - "symfony/polyfill-util": "self.version", - "symfony/polyfill-uuid": "self.version", - "symfony/polyfill-xml": "self.version" + "provide": { + "ext-ctype": "*" }, - "require-dev": { - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/phpunit-bridge": "^5.3|^6.0", - "symfony/var-dumper": "^4.4|^5.1|^6.0" + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "files": [ - "src/bootstrap.php", - "src/Apcu/bootstrap.php", - "src/Ctype/bootstrap.php", - "src/Uuid/bootstrap.php", - "src/Iconv/bootstrap.php", - "src/Intl/Grapheme/bootstrap.php", - "src/Intl/Idn/bootstrap.php", - "src/Intl/Icu/bootstrap.php", - "src/Intl/MessageFormatter/bootstrap.php", - "src/Intl/Normalizer/bootstrap.php", - "src/Mbstring/bootstrap.php" + "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\": "src/" + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + }, + "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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" + }, + "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": "2023-01-26T09:30:37+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, "classmap": [ - "src/Intl/Icu/Resources/stubs", - "src/Intl/MessageFormatter/Resources/stubs", - "src/Intl/Normalizer/Resources/stubs", - "src/Php83/Resources/stubs", - "src/Php82/Resources/stubs", - "src/Php81/Resources/stubs", - "src/Php80/Resources/stubs", - "src/Php73/Resources/stubs" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2173,17 +2311,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfills backporting features to lower PHP versions", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ - "compat", "compatibility", + "intl", + "normalizer", "polyfill", + "portable", "shim" ], "support": { - "issues": "https://github.com/symfony/polyfill/issues", - "source": "https://github.com/symfony/polyfill/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -2199,7 +2338,249 @@ "type": "tidelift" } ], - "time": "2023-08-25T17:27:34+00:00" + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, + "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": "2023-07-28T09:04:16+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + }, + "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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, + "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": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", @@ -2464,5 +2845,5 @@ "php": "^8.1" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/library/includes/page_footer.php b/library/includes/page_footer.php index 7163e4bac..40c14b6d4 100644 --- a/library/includes/page_footer.php +++ b/library/includes/page_footer.php @@ -33,7 +33,7 @@ if (!$bb_cfg['gzip_compress']) { if ($show_dbg_info) { $gen_time = utime() - TIMESTART; - $gen_time_txt = sprintf('%.3f', $gen_time); + $gen_time_txt = sprintf('%.4f', $gen_time); $gzip_text = UA_GZIP_SUPPORTED ? "{$lang['GZIP_COMPRESSION']}: " : "{$lang['GZIP_COMPRESSION']}: "; $gzip_text .= $bb_cfg['gzip_compress'] ? $lang['ON'] : $lang['OFF']; @@ -41,7 +41,7 @@ if ($show_dbg_info) { if (!empty($DBS)) { $sql_t = $DBS->sql_timetotal; - $sql_time_txt = ($sql_t) ? sprintf('%.3f ' . $lang['SEC'] . ' (%d%%) · ', $sql_t, round($sql_t * 100 / $gen_time)) : ''; + $sql_time_txt = ($sql_t) ? sprintf('%.4f ' . $lang['SEC'] . ' (%d%%) · ', $sql_t, round($sql_t * 100 / $gen_time)) : ''; $num_q = $DBS->num_queries; $stat .= "  |  {$DBS->get_db_obj()->engine}: {$sql_time_txt}{$num_q} " . $lang['QUERIES']; }