This repository has been archived by the owner on May 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmunch.php
54 lines (44 loc) · 1.51 KB
/
munch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
define("FILE_PATH", dirname(__FILE__)."/");
ini_set("memory_limit", -1); //Woo
include("src/init.php");
$toppings = array(
"version" => "Provides the protocol and release version.",
"packets" => "Provides minimal information on all network packets.",
"packetinstructions" => "Provides the instructions used to construct network packets.",
"biomes" => "Gets most biome types.",
"blocks" => "Gets most available blocks.",
"items" => "Gets most available items.",
"sounds" => "Finds all named sound effects.",
"methods" => "Finds most method names."
);
if(getp("l", "list") !== null){
$topp = "Toppings: ";
foreach($toppings as $name => $desc){
$topp .= "$name, ";
}
echo substr($topp, 0, -2).PHP_EOL;
die();
}
if(($topp = getp("t", "toppings")) !== null){
$toppings = explode(",", strtolower(str_replace(" ", "", $topp)));
}else{
$toppings = array("version", "packets", "packetinstructions", "biomes", "blocks", "items", "sounds");
}
if(in_array("packetinstructions", $toppings, true) !== false and in_array("packets", $toppings, true) === false){
$toppings[] = "packets";
}
info("[*] Toppings selected: ".implode(",", $toppings));
include("src/parser.php");
$output = array();
$output[] = parser(array_pop($argv), $toppings);
if(getp("c", "compare") !== null){
$output[] = parser(getp("c", "compare"), $toppings);
}
$output = json_encode($output, JSON_PRETTY_PRINT);
if(getp("o", "output") !== null){
file_put_contents(getp("o", "output"), $output);
}else{
echo $output;
}
info(PHP_EOL."[*] Everything done!");