mirror of
				https://gitlab.com/hashborgir/d2tools.git
				synced 2025-10-31 09:03:40 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			620 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			620 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| include "includes.php";
 | |
| 
 | |
| if (file_exists("d2im.db")) {
 | |
| 
 | |
| 	if(file_exists(DB_FILE)) unlink(DB_FILE);
 | |
| 
 | |
| 	$files = new D2Files();
 | |
| 	$parser = new D2TxtParser();
 | |
| 	$db = new D2Database();
 | |
| 
 | |
| 	foreach ($files->files as $k => $v) {
 | |
| 		$data[$v] = $parser->parseFile($v);
 | |
| 	}
 | |
| 	foreach ($data as $k => $v) {
 | |
| 		$db->createTables($k, $v);
 | |
| 		$db->fillsTables($k, $v);
 | |
| 	}
 | |
| }
 | |
| die();
 | |
| // put in html redirect as backup, because 
 | |
| // for some odd reason windows gives
 | |
| // an error on header() but linux does not.
 | |
| ?>
 | |
| <!doctype html>
 | |
| <html lang="en">
 | |
| 	<head>
 | |
| 		<meta http-equiv="refresh" content="0; URL=/" />
 | |
| 	</head>
 | |
| 	<body>
 | |
| 	</body>
 | |
| </html>
 |