-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget_distributions.php
More file actions
executable file
·30 lines (23 loc) · 1007 Bytes
/
get_distributions.php
File metadata and controls
executable file
·30 lines (23 loc) · 1007 Bytes
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
#!/usr/bin/env php
<?php
include "web/pdb/releases.inc";
$print_releases = 0;
if (isset($argv[1]) && ($argv[1] == "-r")) {
$print_releases = 1;
}
$stdout = fopen('php://output', 'w');
if (!$print_releases) {
fputcsv($stdout, array('id', 'name', 'architecture', 'description', 'rcspath', 'priority', 'isactive', 'isvisible', 'issupported'));
foreach ($distributions as $key => $value) {
$distinfo = array($value->getId(), $value->getName(), $value->getArchitecture(), $value->getDescription(), $value->getRcsPath(), $value->getPriority(), $value->isActive(), $value->isVisible(), $value->isSupported());
fputcsv($stdout, $distinfo);
}
} else {
fputcsv($stdout, array('id', 'distribution_id', 'type', 'version', 'priority', 'isactive'));
foreach ($releases as $key => $value) {
$distinfo = array($value->getId(), $value->getDistribution()->getId(), $value->getType(), $value->getVersion(), $value->getPriority(), $value->isActive());
fputcsv($stdout, $distinfo);
}
}
fclose($stdout);
?>