diff --git a/composer.json b/composer.json index d3d05d0c8..fc249ea02 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "pocketmine/log": "^0.2.0", "pocketmine/log-pthreads": "^0.1.0", "pocketmine/callback-validator": "^1.0.1", - "adhocore/json-comment": "^0.1.0" + "adhocore/json-comment": "^0.1.0", + "ocramius/package-versions": "^1.5" }, "require-dev": { "phpstan/phpstan": "^0.12.14", diff --git a/composer.lock b/composer.lock index 78a37fed9..7bb68fa4f 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": "6870d7b85559a32e2929692e0a0da169", + "content-hash": "3449adb803690a36539c03ecb3a8fb3d", "packages": [ { "name": "adhocore/json-comment", @@ -50,6 +50,57 @@ ], "time": "2020-01-03T13:51:23+00:00" }, + { + "name": "ocramius/package-versions", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/1d32342b8c1eb27353c8887c366147b4c2da673c", + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.3.0" + }, + "require-dev": { + "composer/composer": "^1.8.6", + "doctrine/coding-standard": "^6.0.0", + "ext-zip": "*", + "infection/infection": "^0.13.4", + "phpunit/phpunit": "^8.2.5", + "vimeo/psalm": "^3.4.9" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-07-17T15:49:50+00:00" + }, { "name": "pocketmine/binaryutils", "version": "0.1.11", @@ -649,5 +700,6 @@ "ext-zip": "*", "ext-zlib": ">=1.2.11" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/src/pocketmine/CrashDump.php b/src/pocketmine/CrashDump.php index 49c0ff170..9837b501c 100644 --- a/src/pocketmine/CrashDump.php +++ b/src/pocketmine/CrashDump.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace pocketmine; +use PackageVersions\Versions; use pocketmine\network\mcpe\protocol\ProtocolInfo; use pocketmine\plugin\PluginBase; use pocketmine\plugin\PluginLoadOrder; use pocketmine\plugin\PluginManager; use pocketmine\utils\Utils; use pocketmine\utils\VersionString; -use raklib\RakLib; use function base64_encode; use function date; use function error_get_last; @@ -88,7 +88,7 @@ class CrashDump{ * having their content changed, version format changing, etc. * It is not necessary to increase this when adding new fields. */ - private const FORMAT_VERSION = 2; + private const FORMAT_VERSION = 3; private const PLUGIN_INVOLVEMENT_NONE = "none"; private const PLUGIN_INVOLVEMENT_DIRECT = "direct"; @@ -345,18 +345,22 @@ class CrashDump{ $this->data["general"]["is_dev"] = \pocketmine\IS_DEVELOPMENT_BUILD; $this->data["general"]["protocol"] = ProtocolInfo::CURRENT_PROTOCOL; $this->data["general"]["git"] = \pocketmine\GIT_COMMIT; - $this->data["general"]["raklib"] = RakLib::VERSION; $this->data["general"]["uname"] = php_uname("a"); $this->data["general"]["php"] = phpversion(); $this->data["general"]["zend"] = zend_version(); $this->data["general"]["php_os"] = PHP_OS; $this->data["general"]["os"] = Utils::getOS(); + $this->data["general"]["composer_libraries"] = Versions::VERSIONS; $this->addLine($this->server->getName() . " version: " . $version->getFullVersion(true) . " [Protocol " . ProtocolInfo::CURRENT_PROTOCOL . "]"); $this->addLine("Git commit: " . \pocketmine\GIT_COMMIT); $this->addLine("uname -a: " . php_uname("a")); $this->addLine("PHP Version: " . phpversion()); $this->addLine("Zend version: " . zend_version()); $this->addLine("OS : " . PHP_OS . ", " . Utils::getOS()); + $this->addLine("Composer libraries: "); + foreach(Versions::VERSIONS as $library => $libraryVersion){ + $this->addLine("- $library $libraryVersion"); + } } /**