Moved crashdumps to their own folder (#275)

This commit is contained in:
xFlare 2017-01-20 05:52:35 -05:00 committed by Dylan K. Taylor
parent 39c3b16e49
commit 8bf8e2e22f

View File

@ -41,7 +41,10 @@ class CrashDump{
public function __construct(Server $server){
$this->time = time();
$this->server = $server;
$this->path = $this->server->getDataPath() . "CrashDump_" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
if(!is_dir($this->server->getDataPath()) . "crashdumps"){
mkdir($this->server->getDataPath() . "crashdumps");
}
$this->path = $this->server->getDataPath() . "crashdumps/" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
$this->fp = @fopen($this->path, "wb");
if(!is_resource($this->fp)){
throw new \RuntimeException("Could not create Crash Dump");