forked from hmoog/riot-decode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
69 lines (57 loc) · 1.44 KB
/
search.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
57
58
59
60
61
62
63
64
65
66
67
68
<?php
use riotDecode\raf\ExtractedRiotArchiveFileEntry;
// setup php environment
ini_set("memory_limit","512M");
set_time_limit(0);
spl_autoload_register();
$start_time = microtime(true);
// create game folder object
//$gameFolder = new \riotDecode\GameFolder('D:\\9_Perso\\jeux\\Riot\\League of Legends\\');
$gameFolder = 'D:\\9_Perso\\LOL\\GlobalDumped';
$repl = $gameFolder."\\";
$search = null;
if (isset($_REQUEST["search"]))
$search = $_REQUEST["search"];
?>
<html>
<body>
<form name="srch" id="srch">
<input type="text" name="search"/>
<input type="submit" value="SEARCH"/>
</form>
<br>
<?php
if ($search!=null)
{
$foundOne = false;
$indexed = unserialize( file_get_contents( "riotDecode/_private/indexed" ) );
foreach($indexed as $file => $subarray)
{
$match = false;
foreach($subarray as $groupname => $proparray)
{
foreach($proparray as $prop => $value)
{
if (is_array($prop))
$prop = join(",", $prop);
if (is_array($value))
$value = join(",", $value);
if (stristr($prop, $search) !== FALSE || stristr($value, $search) !== FALSE)
{
$prm = str_replace($repl, "", $file);
echo '<a href="explorer.php?current='.$prm.'" target="_blank">'.$file.'</a><br>';
$match = true;
$foundOne = true;
break;
}
}
if ($match)
break;
}
}
}
?>
<br>
This search was done in <?php echo(number_format(microtime(true) - $start_time, 2)); ?> seconds
</body>
</html>