mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
Build URLs from package names (fixes FS#15308, FS#19327).
Drop the "URLPath" field from the "Packages" table, build URLs from package names instead. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
0bb2a7b514
commit
556de318ae
6 changed files with 32 additions and 27 deletions
|
@ -18,10 +18,23 @@ include_once("aur.inc");
|
|||
**/
|
||||
class AurJSON {
|
||||
private $dbh = false;
|
||||
private $exposed_methods = array('search','info','msearch');
|
||||
private $fields = array('Packages.ID','Name','Version','CategoryID',
|
||||
'Description', 'LocationID', 'URL','URLPath','License','NumVotes',
|
||||
'(OutOfDateTS IS NOT NULL) AS OutOfDate');
|
||||
private $exposed_methods = array();
|
||||
private $fields = array();
|
||||
|
||||
/**
|
||||
* Initialize methods and database fields.
|
||||
**/
|
||||
public function __construct() {
|
||||
$this->exposed_methods = array('search', 'info', 'msearch');
|
||||
|
||||
$this->fields = array(
|
||||
'Packages.ID', 'Name', 'Version', 'CategoryID',
|
||||
'Description', 'LocationID', 'URL', 'CONCAT("' .
|
||||
mysql_real_escape_string(URL_DIR) .
|
||||
'", Name, "/", Name, ".tar.gz") AS URLPath', 'License',
|
||||
'NumVotes', '(OutOfDateTS IS NOT NULL) AS OutOfDate'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles post data, and routes the request.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue