Fixed unknown data folders

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-03 12:07:08 +01:00
parent d71167f66c
commit f9c71f1800
2 changed files with 2 additions and 3 deletions

View File

@ -29,12 +29,11 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
var $restart = false;
private $server, $config, $apiList = array();
function __construct(){
console("[INFO] Starting ServerAPI server handler...");
console("[DEBUG] Checking data folders...", true, true, 2);
@mkdir(FILE_PATH."logs/", 0777, true);
@mkdir(FILE_PATH."players/", 0777);
@mkdir(FILE_PATH."worlds/", 0777);
@mkdir(FILE_PATH."plugins/", 0777);
console("[INFO] Starting ServerAPI server handler...");
file_put_contents(FILE_PATH."logs/packets.log", "");
if(!file_exists(FILE_PATH."logs/test.bin.log") or md5_file(FILE_PATH."logs/test.bin.log") !== TEST_MD5){
console("[NOTICE] Executing integrity tests...");

View File

@ -186,7 +186,7 @@ function logg($message, $name, $EOL = true, $level = 2, $close = false){
$fpointers = array();
}
if(!isset($fpointers[$name]) or $fpointers[$name] === false){
$fpointers[$name] = fopen(FILE_PATH."logs/".$name.".log", "ab");
$fpointers[$name] = @fopen(FILE_PATH."logs/".$name.".log", "ab");
}
@fwrite($fpointers[$name], $message);
if($close === true){