-
Notifications
You must be signed in to change notification settings - Fork 8
/
getImport.php
56 lines (48 loc) · 2.6 KB
/
getImport.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
55
56
<?php
$paths = array();
function dirToArray($dir)
{
global $paths;
$cdir = scandir($dir);
foreach ($cdir as $value) {
if (!in_array($value, array(".", ".."))) {
if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) {
dirToArray($dir . DIRECTORY_SEPARATOR . $value);
} else {
$paths[] = $dir . DIRECTORY_SEPARATOR . $value;
}
}
}
}
dirToArray("src");
$tmp = "";
foreach($paths as $path) {
if($path == "src")
continue;
$parts = explode('\\', $path);
$file = array_pop($parts);
if (strpos($file, ".") === false)
continue;
$fileName = explode('.', $file)[0];
$ext = explode('.', $file)[1];
if ($ext !== "as")
continue;
array_shift($parts);
$pathDir = implode('/', $parts);
$tmp .= "import ". str_replace('/', '.', $pathDir) . '.' . $fileName . "; " . str_replace('/', '.', $pathDir) . '.' . $fileName . ";\n";
}
$tmp = str_replace("import .", "import ", $tmp);
$tmp = str_replace("; .", "; ", $tmp);
$tmp = str_replace("import com.sulake.habbo.ui.widget.camera.PhotoPurchaseConfirmationDialog; com.sulake.habbo.ui.widget.camera.PhotoPurchaseConfirmationDialog;", "", $tmp);
$tmp = str_replace("import com.sulake.core.runtime.Profiler; com.sulake.core.runtime.Profiler;", "", $tmp);
$tmp = str_replace("import com.sulake.core.runtime.InterfaceStructList; com.sulake.core.runtime.InterfaceStructList;", "", $tmp);
$tmp = str_replace("import com.sulake.core.runtime.InterfaceStruct; com.sulake.core.runtime.InterfaceStruct;", "", $tmp);
$tmp = str_replace("import com.sulake.core.runtime.ComponentInterfaceQueue; com.sulake.core.runtime.ComponentInterfaceQueue;", "", $tmp);
$tmp = str_replace("import com.sulake.core.communication.wireformat.EvaMessageDataWrapper; com.sulake.core.communication.wireformat.EvaMessageDataWrapper;", "", $tmp);
$tmp = str_replace("import com.sulake.core.assets.loaders.AssetLoaderEventBroker; com.sulake.core.assets.loaders.AssetLoaderEventBroker;", "", $tmp);
$tmp = str_replace("import com.hurlant.math.MontgomeryReduction; com.hurlant.math.MontgomeryReduction;", "", $tmp);
$tmp = str_replace("import com.hurlant.math.IReduction; com.hurlant.math.IReduction;", "", $tmp);
$tmp = str_replace("import com.hurlant.math.ClassicReduction; com.hurlant.math.ClassicReduction;", "", $tmp);
$tmp = str_replace("import com.hurlant.math.BarrettReduction; com.hurlant.math.BarrettReduction;", "", $tmp);
$tmp = str_replace("import com.sulake.core.runtime.ComponentInterfaceQueue; com.sulake.core.runtime.ComponentInterfaceQueue;", "", $tmp);
file_put_contents("import.txt", $tmp);