agallou / mageia-app-db

GNU Affero General Public License v3.0
6 stars 3 forks source link

auto-detect arch and set default filters accordingly #117

Open agallou opened 10 years ago

agallou commented 10 years ago

Author Name: Samuel Verschelde (@stormi) Original Redmine Issue: 101, http://mageia-app-db.tuxette.fr/issues/101 Original Date: 2011/01/16 Original Assignee: Johan Binard


Detection is based on user-agent, see how it was done in easy-urpmi ?

Update: we only have information about arch in the user-agent, forget about distrelease.

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2011/04/16 21:01:38 +0200


Description updated (simpler now)

To Xaris : what interests me most is that auto-detection of the arch based on the user-agent. Setting the default filter will be nice if you can, but otherwise ttp or I will handle it.

agallou commented 10 years ago

Original Redmine Comment Author Name: Adrien Gallou (@agallou) Original Date: 2011/04/17 17:33:49 +0200


the way i see it, you could you could add a

setOption($name, $value) getOption($name) hasOption($name)

to the lib/filtering/baseCriteriaFilter.class.php

then you could change the getDefaultParameters of the lib/actions/madbActions.class.php,

to add just after the line $filter->hasDefault()

a $filter->setOption('user_agent', $_SERVER['HTTP_USER_AGENT']);

then in getDefault method of the archCriteriaFilter and the distreleaseCriteriaFilter

you could do a if ($this->hasOption('user_agent')) then

a if ($this->getOption('user_agent')) then do the logic of return the if of the arch of distrelease based on the user_agent value.

agallou commented 10 years ago

Original Redmine Comment Author Name: Χάρης Υφαντής (Χάρης Υφαντής) Original Date: 2011/05/09 21:36:27 +0200


I have implemented most of the code Adrien suggests above. I still have to pass the arch or distrelease on the corresponding filter and add more distros to be recognized. P.S: this task can be completed after all that but it might need improvements like not setting the $filter->setOption on all filters.

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2011/12/09 22:17:55 +0100


Xaris, what is the status for this task ? Is there a branch I can pull (on which remote if yes?) to finish it if you don't have the time to do it?

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2012/01/21 00:22:05 +0100


ping

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2012/05/08 15:36:51 +0200


ping Xaris

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2012/09/10 14:30:44 +0200


Assigning to Giacomo who volunteered.

agallou commented 10 years ago

Original Redmine Comment Author Name: Samuel Verschelde (@stormi) Original Date: 2013/09/11 20:05:33 +0200


Hi Giacomo. Do you plan to handle this task or should I assign it to our new contributer?