mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
commit
d2fe537159
57
.github/workflows/main.yml
vendored
57
.github/workflows/main.yml
vendored
@ -6,47 +6,26 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-php:
|
|
||||||
name: Prepare PHP
|
|
||||||
runs-on: ${{ matrix.image }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
image: [ubuntu-20.04]
|
|
||||||
php: [8.1.19, 8.2.6]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Build and prepare PHP cache
|
|
||||||
uses: pmmp/setup-php-action@fa2accea978a84097cf40ecc7d46b2d71f258bd5
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php }}
|
|
||||||
install-path: "./bin"
|
|
||||||
pm-version-major: "5"
|
|
||||||
|
|
||||||
phpstan:
|
phpstan:
|
||||||
name: PHPStan analysis
|
name: PHPStan analysis
|
||||||
needs: build-php
|
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [8.1.19, 8.2.6]
|
php: ["8.1", "8.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@fa2accea978a84097cf40ecc7d46b2d71f258bd5
|
uses: pmmp/setup-php-action@2.0.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
install-path: "./bin"
|
install-path: "./bin"
|
||||||
pm-version-major: "5"
|
pm-version-major: "5"
|
||||||
|
|
||||||
- name: Install Composer
|
|
||||||
run: curl -sS https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -58,34 +37,30 @@ jobs:
|
|||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
run: php composer.phar install --prefer-dist --no-interaction
|
run: composer install --prefer-dist --no-interaction
|
||||||
|
|
||||||
- name: Run PHPStan
|
- name: Run PHPStan
|
||||||
run: ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G
|
run: ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G
|
||||||
|
|
||||||
phpunit:
|
phpunit:
|
||||||
name: PHPUnit tests
|
name: PHPUnit tests
|
||||||
needs: build-php
|
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [8.1.19, 8.2.6]
|
php: ["8.1", "8.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@fa2accea978a84097cf40ecc7d46b2d71f258bd5
|
uses: pmmp/setup-php-action@2.0.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
install-path: "./bin"
|
install-path: "./bin"
|
||||||
pm-version-major: "5"
|
pm-version-major: "5"
|
||||||
|
|
||||||
- name: Install Composer
|
|
||||||
run: curl -sS https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -97,20 +72,19 @@ jobs:
|
|||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
run: php composer.phar install --prefer-dist --no-interaction
|
run: composer install --prefer-dist --no-interaction
|
||||||
|
|
||||||
- name: Run PHPUnit tests
|
- name: Run PHPUnit tests
|
||||||
run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit
|
run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit
|
||||||
|
|
||||||
integration:
|
integration:
|
||||||
name: Integration tests
|
name: Integration tests
|
||||||
needs: build-php
|
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [8.1.19, 8.2.6]
|
php: ["8.1", "8.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -118,15 +92,12 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@fa2accea978a84097cf40ecc7d46b2d71f258bd5
|
uses: pmmp/setup-php-action@2.0.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
install-path: "./bin"
|
install-path: "./bin"
|
||||||
pm-version-major: "5"
|
pm-version-major: "5"
|
||||||
|
|
||||||
- name: Install Composer
|
|
||||||
run: curl -sS https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -138,34 +109,30 @@ jobs:
|
|||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
run: php composer.phar install --no-dev --prefer-dist --no-interaction
|
run: composer install --no-dev --prefer-dist --no-interaction
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: ./tests/travis.sh -t4
|
run: ./tests/travis.sh -t4
|
||||||
|
|
||||||
codegen:
|
codegen:
|
||||||
name: Generated Code consistency checks
|
name: Generated Code consistency checks
|
||||||
needs: build-php
|
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [8.1.19, 8.2.6]
|
php: ["8.1", "8.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@fa2accea978a84097cf40ecc7d46b2d71f258bd5
|
uses: pmmp/setup-php-action@2.0.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
install-path: "./bin"
|
install-path: "./bin"
|
||||||
pm-version-major: "5"
|
pm-version-major: "5"
|
||||||
|
|
||||||
- name: Install Composer
|
|
||||||
run: curl -sS https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -177,7 +144,7 @@ jobs:
|
|||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
run: php composer.phar install --no-dev --prefer-dist --no-interaction
|
run: composer install --no-dev --prefer-dist --no-interaction
|
||||||
|
|
||||||
- name: Regenerate registry annotations
|
- name: Regenerate registry annotations
|
||||||
run: php build/generate-registry-annotations.php src
|
run: php build/generate-registry-annotations.php src
|
||||||
|
50
.github/workflows/update-php-versions.php
vendored
50
.github/workflows/update-php-versions.php
vendored
@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
const VERSIONS = [
|
|
||||||
"8.1",
|
|
||||||
"8.2"
|
|
||||||
];
|
|
||||||
|
|
||||||
$workflowFile = file_get_contents(__DIR__ . '/main.yml');
|
|
||||||
$newWorkflowFile = $workflowFile;
|
|
||||||
foreach(VERSIONS as $v){
|
|
||||||
$releaseInfo = file_get_contents("https://secure.php.net/releases?json&version=$v");
|
|
||||||
if($releaseInfo === false){
|
|
||||||
throw new \RuntimeException("Failed to contact php.net API");
|
|
||||||
}
|
|
||||||
$data = json_decode($releaseInfo, true);
|
|
||||||
if(!is_array($data) || !isset($data["version"]) || !is_string($data["version"]) || preg_match('/^\d+\.\d+\.\d+(-[A-Za-z\d]+)?$/', $data["version"]) === 0){
|
|
||||||
throw new \RuntimeException("Invalid data returned by API");
|
|
||||||
}
|
|
||||||
$updated = preg_replace("/$v\.\d+/", $data["version"], $newWorkflowFile);
|
|
||||||
if($updated !== $newWorkflowFile){
|
|
||||||
echo "Updated $v revision to " . $data["version"] . "\n";
|
|
||||||
}
|
|
||||||
$newWorkflowFile = $updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($workflowFile !== $newWorkflowFile){
|
|
||||||
echo "Writing modified workflow file\n";
|
|
||||||
file_put_contents(__DIR__ . '/main.yml', $newWorkflowFile);
|
|
||||||
}
|
|
@ -314,9 +314,6 @@ class MemoryManager{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$property->isPublic()){
|
|
||||||
$property->setAccessible(true);
|
|
||||||
}
|
|
||||||
if(!$property->isInitialized()){
|
if(!$property->isInitialized()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -440,9 +437,6 @@ class MemoryManager{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$property->isPublic()){
|
|
||||||
$property->setAccessible(true);
|
|
||||||
}
|
|
||||||
if(!$property->isInitialized($object)){
|
if(!$property->isInitialized($object)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,6 @@ class CrashDump{
|
|||||||
if(file_exists($filePath)){
|
if(file_exists($filePath)){
|
||||||
$reflection = new \ReflectionClass(PluginBase::class);
|
$reflection = new \ReflectionClass(PluginBase::class);
|
||||||
$file = $reflection->getProperty("file");
|
$file = $reflection->getProperty("file");
|
||||||
$file->setAccessible(true);
|
|
||||||
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
|
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
|
||||||
$filePath = Filesystem::cleanPath($file->getValue($plugin));
|
$filePath = Filesystem::cleanPath($file->getValue($plugin));
|
||||||
if(str_starts_with($frameCleanPath, $filePath)){
|
if(str_starts_with($frameCleanPath, $filePath)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user