Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: OpenFilesLeakDebugger
main: dktapps\OpenFilesLeakDebugger\Main
version: 0.1.0
api: 3.0.0
api: 4.0.0
load: STARTUP
author: dktapps
description: Debugger for file descriptor leaks
Expand Down
7 changes: 5 additions & 2 deletions src/dktapps/OpenFilesLeakDebugger/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace dktapps\OpenFilesLeakDebugger;

use pocketmine\errorhandler\ErrorToExceptionHandler;
use pocketmine\plugin\PluginBase;
use pocketmine\utils\Process;
use pocketmine\utils\Utils;

class Main extends PluginBase{
Expand Down Expand Up @@ -38,8 +40,9 @@ public function onEnable() : void{
$cmd = "lsof -p " . getmypid();
break;
}

if($cmd !== null){
@Utils::execute($cmd, $stdout, $stderr);
@Process::execute($cmd, $stdout, $stderr);
$this->getLogger()->emergency("File descriptor leak results:");
$this->getLogger()->emergency("stdout:\n$stdout");
$this->getLogger()->emergency("stderr:\n$stderr");
Expand All @@ -49,7 +52,7 @@ public function onEnable() : void{
}
}

return Utils::errorExceptionHandler($severity, $message, $file, $line);
return ErrorToExceptionHandler::handle($severity, $message, $file, $line);
});

//For testing the plugin itself only.
Expand Down