示例#1
0
 function _resolveServices($serviceName)
 {
     if ($this->{$serviceName} == NULL) {
         if (isset($this->detectFlags[$serviceName]) && $this->detectFlags[$serviceName] == true) {
             //$results =& AppContext::getServicesByNameMatchEnd($serviceName);
             $results =& AppContext::getServicesOfType($serviceName);
             usort(&$results, 'order_comparator');
             $this->{$serviceName} =& $results;
         }
         if ($this->{$serviceName} == NULL || empty($this->{$serviceName})) {
             $this->{$serviceName} =& $this->_getDefaultStrategy($serviceName);
             if (log_enabled(LOG_DEBUG)) {
                 log_message(LOG_DEBUG, 'Using ' . $serviceName . ' [' . get_class($this->{$serviceName}) . ']');
             }
         }
     }
     if (!is_array($this->{$serviceName})) {
         $array = array();
         $array[] = $this->{$serviceName};
         $this->{$serviceName} =& $array;
     }
 }