Subversion Repositories SvarDOS

Rev

Rev 1508 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1508 Rev 1791
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
  pkgnet interface
4
  pkgnet interface
5
  Copyright (C) 2021-2022 Mateusz Viste
5
  Copyright (C) 2021-2024 Mateusz Viste
6
 
6
 
7
 === API ===
7
 === API ===
8
  ?a=pull&p=PACKAGE[-VER]     downloads the svp archive of PACKAGE (possibly of VER version)
8
  ?a=pull&p=PACKAGE[-VER]     downloads the svp archive of PACKAGE (possibly of VER version)
9
  ?a=pullsrc&p=PACKAGE[-VER]  downloads the source zip of PACKAGE (possibly of VER version)
9
  ?a=pullsrc&p=PACKAGE[-VER]  downloads the source zip of PACKAGE (possibly of VER version)
10
  ?a=search&p=PHRASE[::cat]   list packages that match PHRASE (possibly filtered by cat category)
10
  ?a=search&p=PHRASE[::cat]   list packages that match PHRASE (possibly filtered by cat category)
Line 110... Line 110...
110
  }
110
  }
111
  // pull and pullsrc actions accept pkg-ver strings
111
  // pull and pullsrc actions accept pkg-ver strings
112
  if ($a == 'pull' || $a == 'pullsrc') {
112
  if ($a == 'pull' || $a == 'pullsrc') {
113
    $pv = explode('-', strtolower($_GET['p']));
113
    $pv = explode('-', strtolower($_GET['p']));
114
    $p = $pv[0];
114
    $p = $pv[0];
115
    if (!empty($pv[1])) $v = $pv[1];
115
    if (!empty($pv[1])) {
-
 
116
      // space is not a valid character in a version string, if there is any then it must have been a plus sign (as in "1.0+1") but it got changed to a space by the www server because pkgnet does not perform url percent-encoding. So I'm changing it back to a plus here.
-
 
117
      $v = strtr($pv[1], ' ', '+');
-
 
118
    }
116
  } else {
119
  } else {
117
    $p = strtolower($_GET['p']);
120
    $p = strtolower($_GET['p']);
118
  }
121
  }
119
}
122
}
120
 
123