mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
MemoryManager: Fixed parent private properties not being visible in memory dumps
This commit is contained in:
parent
40e5a1aacb
commit
4a8232d591
@ -394,15 +394,22 @@ class MemoryManager{
|
|||||||
$info["implements"] = implode(", ", $reflection->getInterfaceNames());
|
$info["implements"] = implode(", ", $reflection->getInterfaceNames());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for($original = $reflection; $reflection !== false; $reflection = $reflection->getParentClass()){
|
||||||
foreach($reflection->getProperties() as $property){
|
foreach($reflection->getProperties() as $property){
|
||||||
if($property->isStatic()){
|
if($property->isStatic()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$name = $property->getName();
|
||||||
|
if($reflection !== $original and !$property->isPublic()){
|
||||||
|
$name = $reflection->getName() . ":" . $name;
|
||||||
|
}
|
||||||
if(!$property->isPublic()){
|
if(!$property->isPublic()){
|
||||||
$property->setAccessible(true);
|
$property->setAccessible(true);
|
||||||
}
|
}
|
||||||
self::continueDump($property->getValue($object), $info["properties"][$property->getName()], $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
|
||||||
|
self::continueDump($property->getValue($object), $info["properties"][$name], $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($obData, "$hash@$className: " . json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");
|
fwrite($obData, "$hash@$className: " . json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user