]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
sort output of blocked list by block timestamp
[nominatim.git] / lib / lib.php
index 20f5af17787c7386cd98594f74c1e5c30198ead5..0af91e2d89a348091d8726bfc151776afb0d165a 100644 (file)
                return $iMaxVal;
         }
 
+       function byLastBlockTime($a, $b)
+       {
+               if ($a['lastBlockTimestamp'] == $b['lastBlockTimestamp'])
+               {
+                       return 0;
+               }
+               return ($a['lastBlockTimestamp'] > $b['lastBlockTimestamp']) ? -1 : 1;
+       }
+
        function getBucketBlocks()
        {
                $m = getBucketMemcache();
                                'currentlyBlocked' => $iCurrentBucketSize + (CONST_ConnectionBucket_Cost_Reverse) >= CONST_ConnectionBucket_BlockLimit,
                                );
                }
+               uasort($aBlockedList, 'byLastBlockTime');
                return $aBlockedList;
        }