Changeset 15193

Show
Ignore:
Timestamp:
02/22/08 16:09:56 (6 months ago)
Author:
rambo
Message:

sort the queue dirs as well in stead of trusting (the undefined by posix standard) filesystem order

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.helper.replicator/queuemanager.php

    r15149 r15193  
    586586        { 
    587587            debug_add('Could not get base dir for subscription', MIDCOM_LOG_ERROR); 
    588             return
     588            return false
    589589        } 
    590590        $dp_queues = opendir($subscription_path); 
     
    592592        { 
    593593            debug_add("Could not open dir '{$subscription_path}' for reading", MIDCOM_LOG_ERROR); 
    594             return; 
    595         } 
    596         // TODO: refactor these loops to separate methods 
     594            return false; 
     595        } 
     596 
     597        $queues = array(); 
    597598        while (($queue_name = readdir($dp_queues)) !== false) 
     599        { 
     600            $queues[$queue_name] = $queue_name; 
     601        } 
     602        closedir($dp_queues); 
     603        uksort($queues, array($this, '_process_queue_sort_items')); 
     604        reset($queues); 
     605 
     606        foreach ($queues as $queue_name) 
    598607        { 
    599608            if ($this->_process_queue_queuepath($queue_name, $subscription_path, $subscription) === false) 
     
    605614            } 
    606615        } 
    607         closedir($dp_queues); 
     616 
    608617        debug_pop(); 
    609618        return true;