Bug #17861 » bug.txt

Administrator Admin, 2007-11-28 21:14

 
1
This list not sorted!
2
$versions = array_keys($this->xmlhandler->extensionsXML[$extKey]['versions']);
3
$latestVersion = end($versions);
4

    
5
On line: 1610,1735,1382......
6

    
7
User this sort Function from Elmar Hinz:
8

    
9
Own 
10
------------------------------------------------
11
------------------------------------------------
12
Sort: 
13
------------------------------------------------
14
  usort($versions, array('SC_mod_tools_em_index', 'compare'));
15
------------------------------------------------
16
------------------------------------------------
17
Function:
18
------------------------------------------------
19
	function compare($aIn, $bIn) {
20
		$aParts = explode('.', $aIn, 2);
21
		$bParts = explode('.', $bIn, 2);
22
		$a = (int) $aParts[0];
23
		$b = (int) $bParts[0];
24
		if($a > $b){
25
			return 1;
26
		}elseif($a < $b){
27
			return -1;
28
		} else {
29
			if(is_string($aParts[1])) {
30
					return SC_mod_tools_em_index::compare($aParts[1], $bParts[1]);
31
			} else {
32
				return 0;
33
			}
34
		}
35
	}
36
------------------------------------------------
37
------------------------------------------------
38

    
39
regards Micha Barthel 
(1-1/2)