Require ext-chunkutils2 at ^0.2.0

This commit is contained in:
Dylan K. Taylor 2021-03-23 22:21:57 +00:00
parent aa8c13ec45
commit 0d775f8731
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
5 changed files with 20 additions and 95 deletions

View File

@ -7,7 +7,7 @@
"require": {
"php": "^7.4 || ^8.0",
"php-64bit": "*",
"ext-chunkutils2": "^0.1.0",
"ext-chunkutils2": "^0.2.0",
"ext-crypto": "^0.3.1",
"ext-ctype": "*",
"ext-curl": "*",

4
composer.lock generated
View File

@ -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": "824d613db4986bce5882e3460ef32826",
"content-hash": "7846da3098ad1a3e694ed3dfa5eedda3",
"packages": [
{
"name": "adhocore/json-comment",
@ -3460,7 +3460,7 @@
"platform": {
"php": "^7.4 || ^8.0",
"php-64bit": "*",
"ext-chunkutils2": "^0.1.0",
"ext-chunkutils2": "^0.2.0",
"ext-crypto": "^0.3.1",
"ext-ctype": "*",
"ext-curl": "*",

View File

@ -33,6 +33,12 @@ namespace pocketmine {
use pocketmine\utils\Terminal;
use pocketmine\utils\Timezone;
use pocketmine\wizard\SetupWizard;
use function extension_loaded;
use function phpversion;
use function preg_match;
use function preg_quote;
use function strpos;
use function version_compare;
require_once __DIR__ . '/VersionInfo.php';
@ -121,6 +127,16 @@ namespace pocketmine {
}
}
$chunkutils2_version = phpversion("chunkutils2");
$wantedVersionLock = "0.2";
$wantedVersionMin = "$wantedVersionLock.0";
if($chunkutils2_version !== false && (
version_compare($chunkutils2_version, $wantedVersionMin) < 0 ||
preg_match("/^" . preg_quote($wantedVersionLock, "/") . "\.\d+$/", $chunkutils2_version) === 0 //lock in at ^0.2, optionally at a patch release
)){
$messages[] = "chunkutils2 ^$wantedVersionMin is required, while you have $chunkutils2_version.";
}
if(extension_loaded("pocketmine")){
$messages[] = "The native PocketMine extension is no longer supported.";
}

File diff suppressed because one or more lines are too long

View File

@ -53,7 +53,7 @@ PHP_BUILD_INSTALL_EXTENSION="\
pthreads=@acc6e52b2144c61c434b62a3cb680d537e06828e \
yaml=2.2.1 \
leveldb=@60763a09bf5c7a10376d16e25b078b99a35c5c37 \
chunkutils2=@7aec31a9dfc83ddead8870dc0a29159596939680 \
chunkutils2=@0.2.0 \
morton=@0.1.2 \
igbinary=3.2.1 \
" PHP_BUILD_ZTS_ENABLE=on PHP_BUILD_CONFIGURE_OPTS='--with-gmp' ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1