summaryrefslogtreecommitdiff
blob: d22f6d52e381786e2f002bdb0317ad9fc1e396cd (plain)
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
<?

	require_once 'header.php';
	
	if(!$tree) {
		$tree =& PortageTree::singleton();
	}
	
	$table = 'license';
	
	$arr = $tree->getLicenses();
	
	$arr_diff = importDiff($table, $arr);
	
	if(count($arr_diff['delete'])) {
		foreach($arr_diff['delete'] as $name) {
			$sql = "DELETE FROM $table WHERE name = ".$db->quote($name).";";
			$db->query($sql);
		}
	}
	
	if(count($arr_diff['insert'])) {
		foreach($arr_diff['insert'] as $name) {
			$arr_insert = array('name' => $name);
			$db->autoExecute($table, $arr_insert, MDB2_AUTOQUERY_INSERT);
		}
	}
	
	unset($arr, $arr_diff);

?>