Line ending cleanup

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-02 19:41:23 +01:00
parent aafd36859f
commit db1b7ec4f2
2 changed files with 11 additions and 19 deletions

5
.gitattributes vendored
View File

@ -1,5 +1,10 @@
# Auto detect text files and perform LF normalization
* text=auto
*.php text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.properties text eol=lf
*.bat text eol=crlf
# Custom for Visual Studio
*.cs diff=csharp

View File

@ -29,24 +29,11 @@ require_once("src/common/dependencies.php");
require_once("classes/PocketMinecraftServer.class.php");
require_once("API/ServerAPI.php");
while(true){
$server = new ServerAPI();
if($server->start() !== true){
break;
}else{
console("[INFO] Cleaning up...");
hard_unset($server);
$excludeList = array("GLOBALS", "_FILES", "_COOKIE", "_POST", "_GET", "excludeList");
foreach(get_defined_vars() as $key => $value){
if(!in_array($key, $excludeList)){
$$key = null;
unset($$key);
}
}
$server = null;
unset($server);
console("[NOTICE] The server is restarting... (".gc_collect_cycles()." cycles collected)", true, true, 0);
}
$server = new ServerAPI();
if($server->start() !== true){
//Stop
}else{
//Restart
}
kill(getmypid());
kill(getmypid()); //Fix for segfault