Exemplo n.º 1
0
 public function getConfiguration($set, $group = null)
 {
     \cherry\log(\cherry\LOG_DEBUG, __CLASS__ . "->GetConfiguration: (set=%s, group=%s)", $set, $group);
     if (empty($this->cfgsets[$set])) {
         throw new ApplicationException(_('Configuration set could not be found'), ApplicationException::ERR_CONFIG_NOT_FOUND);
     }
     $ret = $this->cfgsets[$set];
     if ($group) {
         $groups = array_keys($ret);
         $out = null;
         foreach ($groups as $g) {
             if (strpos($g, ':') !== false) {
                 list($gn, $gp) = explode(':', $g);
             } else {
                 $gn = $g;
                 $gp = null;
             }
             if (trim($gn) == $group) {
                 if ($gp) {
                     $out = $this->getConfiguration($set, trim($gp));
                     $grp = $ret[$g];
                     foreach ($grp as $k => $v) {
                         $out[$k] = $v;
                     }
                 } else {
                     $out = $ret[$group];
                 }
             }
         }
         $ret = $out;
     }
     return $ret;
 }
Exemplo n.º 2
0
 public function __construct($host, $port, $flags = 0x0)
 {
     \cherry\log(\cherry\LOG_DEBUG, 'Creating new proxy (%s)', get_class($this));
 }