Create server.log properly on non-existent directories

This commit is contained in:
Shoghi Cervantes 2014-11-02 16:15:15 +01:00
parent f7baf46a54
commit af4eb2ab1e
2 changed files with 4 additions and 1 deletions

View File

@ -126,6 +126,9 @@ namespace pocketmine {
define("pocketmine\\ANSI", (Utils::getOS() !== "win" or isset($opts["enable-ansi"])) and !isset($opts["disable-ansi"]));
@mkdir(\pocketmine\DATA, 0777, true);
//Logger has a dependency on timezone, so we'll set it to UTC until we can get the actual timezone.
date_default_timezone_set("UTC");
$logger = new MainLogger(\pocketmine\DATA . "server.log", \pocketmine\ANSI);

View File

@ -1455,7 +1455,7 @@ class Server{
$this->autoloader = $autoloader;
$this->logger = $logger;
$this->filePath = $filePath;
@mkdir($dataPath . "worlds/", 0777, true);
@mkdir($dataPath . "worlds/", 0777);
@mkdir($dataPath . "players/", 0777);
@mkdir($pluginPath, 0777);