-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplist.php
More file actions
executable file
·126 lines (114 loc) · 4.42 KB
/
Copy pathplist.php
File metadata and controls
executable file
·126 lines (114 loc) · 4.42 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
require "include/connect.inc.php";
/*
PLIST in Datei schreiben so dass sie NSDictionary lesen kann
arguments:
all=x show all (even if not yet approved)
since="2005-12-12" filter entries older than date
rom=xxx filter by ROM
appid=xxx specified app only
limit=xxx specify limit (default = 100)
result is an NSArray filled with NSDictionaries where database columns are the keys
*/
header("Content-Encoding: text/xml");
header("Cache-Control: no-transform", false);
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?><!DOCTYPE plist PUBLIC "-//GNUstep//DTD plist 0.9//EN" "http://www.gnustep.org/plist-0_9.xml">
<plist version="0.9">
<array>
<?php // make propertly list of requested (new) application(s) in database
$query="select *, DATE_FORMAT(updated, '%e %b %Y') as upd from ${DB_TABLE}";
if($_GET['all'])
$query.=" where approved=approved"; // any...
else
$query.=" where approved=1";
if($_GET['rom'])
$query.=" and rom=".quote($_GET['rom']);
if($_GET['appid'])
$query.=" and id=".quote($_GET['appid']);
if($_GET['since'])
$query.=" and updated >= ".quote($_GET['since']);
$query.=" order by updated desc";
if($_GET['limit'])
$query.=" limit ".quote($_GET['limit']);
else
$query.=" limit 100";
// echo $query;
$result=query($query);
$translate=array(
/* we don't use translations any more (they make things more complicated than they try to solve) ...
"name" => "CFBundleName",
"version" => "IFPkgBuildVersion",
"updated" => "IFPkgBuildDate",
"description" => "IFPkgDescriptionDescription",
"summary" => "IFPkgDescriptionTitle",
"downloadurl" => "IFPkgFlagPackageLocation",
*/
/* map
added = "2006-12-19 19:12:43";
approved = 1;
author = "A. Junghans, H. N. Schaller";
category1 = Runtime;
downloadurl = "http://www.dsitri.de/download/AJZaurusUSB-0.5.3.tgz";
homepageurl = "http://www.dsitri.de/wiki.php?page=AJZaurusUSB";
id = 4436;
license = GPL;
maturity = alpha;
model = "PowerPC and Intel Macs";
price = "0.00";
rom = "MacOS X";
screen0 = 1;
sourceurl = "http://www.dsitri.de/download/AJZaurusUSB-0.5.3-src.tgz";
summary = "MacOS X Ethernet over USB Driver for Zaurus and other handheld devices";
upd = "12 Oct 2007";
updated = "2007-10-12 13:22:08";
views = 630;
to
NSString *IFMajorVersion=@"IFMajorVersion";
NSString *IFMinorVersion=@"IFMinorVersion";
NSString *IFPkgBuildDate=@"IFPkgBuildDate";
NSString *IFPkgBuildVersion=@"IFPkgBuildVersion";
NSString *IFPkgFlagAuthorizationAction=@"IFPkgFlagAuthorizationAction";
NSString *IFPkgFlagBackgroundAlignment=@"IFPkgFlagBackgroundAlignment";
NSString *IFPkgFlagBackgroundScaling=@"IFPkgFlagBackgroundScaling";
NSString *IFPkgFlagComponentDirectory=@"IFPkgFlagComponentDirectory";
NSString *IFPkgFlagDefaultLocation=@"IFPkgFlagDefaultLocation";
NSString *IFPkgFlagFollowLinks=@"IFPkgFlagFollowLinks";
NSString *IFPkgFlagInstalledSize=@"IFPkgFlagInstalledSize";
NSString *IFPkgFlagInstallFat=@"IFPkgFlagInstallFat";
NSString *IFPkgFlagIsRequired=@"IFPkgFlagIsRequired";
NSString *IFPkgFlagOverwritePermissions=@"IFPkgFlagOverwritePermissions";
NSString *IFPkgFlagRootVolumeOnly=@"IFPkgFlagRootVolumeOnly";
NSString *IFPkgFlagPackageList=@"IFPkgFlagPackageList";
NSString *IFPkgFlagPackageLocation=@"IFPkgFlagPackageLocation"; // subdict in IFPkgFlagPackageList array
NSString *IFPkgFlagPackageSelection=@"IFPkgFlagPackageSelection"; // subdict in IFPkgFlagPackageList array
NSString *IFPkgFormatVersion=@"IFPkgFormatVersion";
NSString *IFPkgHideSubpackages=@"IFPkgHideSubpackages";
NSString *IFPkgPayloadFileCount=@"IFPkgPayloadFileCount";
NSString *IFPkgRequiredSLA=@"requiredSLA";
NSString *IFPkgDescriptionDescription=@"IFPkgDescriptionDescription";
NSString *IFPkgDescriptionTitle=@"IFPkgDescriptionTitle";
NSString *IFPkgDescriptionVersion=@"IFPkgDescriptionVersion";
*/
);
while($row=mysql_fetch_array($result))
{
echo "<dict>\n";
reset($row);
while(list($key, $value) = each($row))
{
if(is_numeric($key))
continue; // skip 1,2,3 etc.
if(!$value)
continue; // omit empty fields
if($translate[$key])
$key=$translate[$key];
echo "<key>".htmlspecialchars($key, ENT_NOQUOTES)."</key>\n";
echo "<string>".htmlspecialchars($value, ENT_NOQUOTES)."</string>\n";
}
echo "</dict>\n";
}
mysql_free_result($result);
?>
</array>
</plist>