mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			501 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			501 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
include( "config.php" );
 | 
						|
 | 
						|
$sql_file = $sqlfile ?: 'build.sql';
 | 
						|
$sql_fh     = fopen( $sql_file, 'r' );
 | 
						|
$connection = mysql_connect( $config['db_host'], $config['db_user'], $config['db_pass'] );
 | 
						|
mysql_select_db( $config['db_name']  );
 | 
						|
 | 
						|
while( !feof( $sql_fh ) ) {
 | 
						|
  $line     = fgetss( $sql_fh );
 | 
						|
  if(!empty($line))
 | 
						|
  {
 | 
						|
    $creation = mysql_query( $line );
 | 
						|
    if( !$creation ) {
 | 
						|
      echo( mysql_error() . "\n" );
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
fclose($sql_fh);
 | 
						|
 | 
						|
include("includes/sql-schema/update.php");
 | 
						|
 | 
						|
?>
 |