Merge remote-tracking branch 'origin/stable'

# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
This commit is contained in:
Dylan K. Taylor
2020-12-20 20:54:13 +00:00
18 changed files with 221 additions and 127 deletions

View File

@ -30,6 +30,8 @@ use function fclose;
use function file;
use function file_get_contents;
use function function_exists;
use function getmypid;
use function getmyuid;
use function hexdec;
use function memory_get_usage;
use function posix_kill;
@ -173,4 +175,20 @@ final class Process{
return proc_close($process);
}
public static function pid() : int{
$result = getmypid();
if($result === false){
throw new \LogicException("getmypid() doesn't work on this platform");
}
return $result;
}
public static function uid() : int{
$result = getmyuid();
if($result === false){
throw new \LogicException("getmyuid() doesn't work on this platform");
}
return $result;
}
}