summaryrefslogtreecommitdiff
blob: e004a5c9e36a68b1a96e384237edbff5862bb057 (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
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
<?
	
	require_once 'class.db.category.php';	
	
	if($package_id) {
	
		$db_package = new DBPackage($package_id);
		$c = new DBCategory($db_package->category);
		
		$category_name = $c->name;
		
// 		Common::pre($db_package->arr_db);
	
		$str = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<package>
</package>
XML;

 		$sxe = new SimpleXMLElement($str);
 		$child = $sxe->addChild('category');
 		$child->addAttribute('name', $category_name);
 		
 		$child = $sxe->addChild('ebuild');
 		$child->addAttribute('pf', '1.2.0');
 		
 		$sql = "SELECT DISTINCT category_name, package_name FROM view_reverse_depend WHERE package = ".$db->quote($package_id)." ORDER BY category_name, package_name;";
		$arr = $db->getAll($sql);
		
		if(count($arr)) {
		
			
		
			foreach($arr as $row) {
				extract($row);
				$child = $sxe->addChild('dependency');
				$child->addChild('type', 'reverse');
				$child->addChild('category_name', $category_name);
				$child->addChild('package_name', $package_name);
			}
				
		}
 		
 		$sxe->addChild('description', htmlspecialchars($db_package->description));
//  		$sxe->addChild('changelog', htmlspecialchars($db_package->changelog));
 		
 		
		echo $sxe->asXML();
 		
			

		
	}
	
	
	
	
?>