loadBackends() публичный статический Метод

Loads the backends.php configuration file.
public static loadBackends ( ) : array
Результат array Configuration data.
Пример #1
0
 /**
  * @see Horde_Registry_Application#perms()
  */
 public function perms()
 {
     $perms = array('backends' => array('title' => _("Backends")));
     foreach (array_keys(Ingo::loadBackends()) as $key) {
         $bkey = 'backends:' . $key;
         $perms[$bkey] = array('title' => $key);
         foreach ($this->_perms as $key2 => $val2) {
             $perms[$bkey . ':' . $key2] = array('title' => $val2['title'], 'type' => $val2['type']);
         }
     }
     return $perms;
 }
Пример #2
0
 /**
  * Returns all rulesets a user has access to.
  *
  * @return array  The ruleset list.
  */
 protected function _listRulesets()
 {
     global $injector, $registry;
     if (isset($this->_rulesets)) {
         return $this->_rulesets;
     }
     $this->_rulesets = array();
     try {
         if (!($share = $injector->getInstance('Ingo_Shares'))) {
             return $this->_rulesets;
         }
         $tmp = $share->listShares($registry->getAuth(), array('perm' => Horde_Perms::SHOW));
     } catch (Horde_Share_Exception $e) {
         Horde::log($e, 'ERR');
         return $this->_rulesets;
     }
     /* Check if filter backend of the share still exists. */
     $backends = Ingo::loadBackends();
     foreach ($tmp as $id => $ruleset) {
         list($backend) = explode(':', $id);
         if (isset($backends[$backend])) {
             $this->_rulesets[$id] = $ruleset;
         }
     }
     return $this->_rulesets;
 }
Пример #3
0
 /**
  * Determine the backend to use.
  *
  * This decision is based on the global 'SERVER_NAME' and 'HTTP_HOST'
  * server variables and the contents of the 'preferred' either field
  * in the backend's definition.  The 'preferred' field may take a
  * single value or an array of multiple values.
  *
  * @return array  The backend entry.
  * @throws Ingo_Exception
  */
 protected static function _getBackend()
 {
     $backend = null;
     foreach (Ingo::loadBackends() as $name => $val) {
         $val['id'] = $name;
         if (!isset($backend)) {
             $backend = $val;
         } elseif (!empty($val['preferred'])) {
             if (is_array($val['preferred'])) {
                 foreach ($val['preferred'] as $v) {
                     if ($v == $_SERVER['SERVER_NAME'] || $v == $_SERVER['HTTP_HOST']) {
                         $backend = $val;
                     }
                 }
             } elseif ($val['preferred'] == $_SERVER['SERVER_NAME'] || $val['preferred'] == $_SERVER['HTTP_HOST']) {
                 $backend = $val;
             }
         }
     }
     /* Check for valid backend configuration. */
     if (is_null($backend)) {
         throw new Ingo_Exception(_("No backend configured for this host"));
     }
     foreach (array('script', 'transport') as $val) {
         if (empty($backend[$val])) {
             throw new Ingo_Exception(sprintf(_("No \"%s\" element found in backend configuration."), $val));
         }
     }
     return $backend;
 }