Retrieve the namespace information for this connection.
public getNamespace ( ) : Horde_Kolab_Storage_Folder_Namespace | ||
리턴 | Horde_Kolab_Storage_Folder_Namespace | The initialized namespace handler. |
/** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->getBackend()->hasCapability('NAMESPACE') === true) { $namespaces = array(); foreach ($this->getBackend()->getNamespace() as $type => $elements) { foreach ($elements as $namespace) { switch ($type) { case 'others': $namespace['type'] = 'other'; break; default: $namespace['type'] = $type; break; } $namespace['delimiter'] = $namespace['delimter']; $namespaces[] = $namespace; } } return new Horde_Kolab_Storage_Folder_Namespace_Imap($this->getAuth(), $namespaces, $this->getParam('namespaces', array())); } return parent::getNamespace(); }
/** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->getBackend()->getCapability('NAMESPACE') === true) { $namespaces = array(); foreach ($this->getBackend()->getNamespace() as $type => $elements) { if (is_array($elements)) { foreach ($elements as $namespace) { $namespace['name'] = $namespace[0]; $namespace['delimiter'] = $namespace[1]; $namespace['type'] = $type; $namespaces[] = $namespace; } } } $this->_namespace = $this->getFactory()->createNamespace('imap', $this->getAuth(), $namespaces); } return parent::getNamespace(); }
/** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->_namespace !== null) { return parent::getNamespace(); } try { $this->getBackend()->login(); if ($this->getBackend()->queryCapability('NAMESPACE') === true) { $c = array(); $configuration = $this->getParam('namespaces', array()); foreach ($this->getBackend()->getNamespaces() as $namespace) { if (in_array($namespace['name'], array_keys($configuration))) { $namespace = array_merge($namespace, $configuration[$namespace['name']]); } switch ($namespace['type']) { case Horde_Imap_Client::NS_PERSONAL: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::PERSONAL; break; case Horde_Imap_Client::NS_OTHER: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::OTHER; break; case Horde_Imap_Client::NS_SHARED: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::SHARED; break; } $c[] = $namespace; } $this->_namespace = $this->getFactory()->createNamespace('imap', $this->getAuth(), $c); } } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return parent::getNamespace(); }