mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user