6 $proc = proc_open("./$script php", array(
7 0 => array('pipe', 'r'),
8 1 => array('pipe', 'w'),
9 2 => array('pipe', 'w')
11 foreach ($_GET as $k => $v) {
12 fwrite($pipes[0], urlencode($k)."=".urlencode($v)."\n");
16 $stderr = fread($pipes[2], 4096);
17 $exit = proc_close($proc);
19 echo "<h1>Error happened, code $exit</h1>\n";
21 echo "<pre>".htmlspecialchars($stderr);
25 $SUITES = array('oldstable', 'stable', 'testing', 'unstable', 'experimental');
26 $pi = substr($_SERVER["PATH_INFO"], 1);
27 $elems = explode('/', $pi);
29 readfile("index.html");
31 } elseif ($pi == 'search') {
32 go("search_packages.pl");
33 } elseif ($elems[0] == 'package' && count($elems) == 2) {
34 $_GET['searchon'] = 'names';
35 $_GET['keywords'] = $elems[1];
36 $_GET['suite'] = 'all';
38 go("search_packages.pl");
39 } elseif ($elems[0] == 'source' && count($elems) == 2) {
40 $_GET['searchon'] = 'sourcenames';
41 $_GET['keywords'] = $elems[1];
42 $_GET['suite'] = 'all';
44 go("search_packages.pl");
45 } elseif (in_array($elems[0], $SUITES) && count($elems) == 2) {
46 $_GET['package'] = $elems[1];
47 $_GET['suite'] = $elems[0];
48 go("show_package.pl");
49 } elseif (in_array($elems[0], $SUITES) && count($elems) == 3) {
50 header("Location: http://merkel.debian.org/~jeroen/pdo/$elems[0]/".urlencode($elems[2]));
52 } elseif (substr($pi, 0, 4) == 'src:') {
53 header("Location: http://merkel.debian.org/~jeroen/pdo/source/".urlencode(substr($pi,4)));
55 } elseif (!eregi('[^a-z0-9+.-]', $pi)) {
56 header("Location: http://merkel.debian.org/~jeroen/pdo/package/".urlencode($pi));