Overview

Packages

  • Kolab
    • Server

Classes

  • Horde_Kolab_Server_Composite
  • Horde_Kolab_Server_Connection_File
  • Horde_Kolab_Server_Connection_Mock
  • Horde_Kolab_Server_Connection_Mock_Ldap
  • Horde_Kolab_Server_Connection_Mock_Search
  • Horde_Kolab_Server_Connection_Simpleldap
  • Horde_Kolab_Server_Connection_Splittedldap
  • Horde_Kolab_Server_Decorator_Clean
  • Horde_Kolab_Server_Decorator_Count
  • Horde_Kolab_Server_Decorator_Log
  • Horde_Kolab_Server_Decorator_Map
  • Horde_Kolab_Server_Exception
  • Horde_Kolab_Server_Exception_Bindfailed
  • Horde_Kolab_Server_Exception_Novalue
  • Horde_Kolab_Server_Factory
  • Horde_Kolab_Server_Ldap
  • Horde_Kolab_Server_Ldap_Changes
  • Horde_Kolab_Server_Ldap_Filtered
  • Horde_Kolab_Server_Ldap_Standard
  • Horde_Kolab_Server_List_Base
  • Horde_Kolab_Server_Object_Attribute_Base
  • Horde_Kolab_Server_Object_Attribute_Createtimestamp
  • Horde_Kolab_Server_Object_Attribute_Createtimestampdate
  • Horde_Kolab_Server_Object_Attribute_Decorator
  • Horde_Kolab_Server_Object_Attribute_Default
  • Horde_Kolab_Server_Object_Attribute_Empty
  • Horde_Kolab_Server_Object_Attribute_External
  • Horde_Kolab_Server_Object_Attribute_Field
  • Horde_Kolab_Server_Object_Attribute_Firstnamelastname
  • Horde_Kolab_Server_Object_Attribute_Guid
  • Horde_Kolab_Server_Object_Attribute_Id
  • Horde_Kolab_Server_Object_Attribute_Internal
  • Horde_Kolab_Server_Object_Attribute_Locked
  • Horde_Kolab_Server_Object_Attribute_Modifytimestamp
  • Horde_Kolab_Server_Object_Attribute_Modifytimestampdate
  • Horde_Kolab_Server_Object_Attribute_Objectclass
  • Horde_Kolab_Server_Object_Attribute_Openldapaci
  • Horde_Kolab_Server_Object_Attribute_Required
  • Horde_Kolab_Server_Object_Attribute_Single
  • Horde_Kolab_Server_Object_Attribute_Value
  • Horde_Kolab_Server_Object_Attribute_Writelock
  • Horde_Kolab_Server_Object_Base
  • Horde_Kolab_Server_Object_Factory
  • Horde_Kolab_Server_Object_Groupofnames
  • Horde_Kolab_Server_Object_Hash
  • Horde_Kolab_Server_Object_Inetorgperson
  • Horde_Kolab_Server_Object_Kolab
  • Horde_Kolab_Server_Object_Kolab_Address
  • Horde_Kolab_Server_Object_Kolab_Administrator
  • Horde_Kolab_Server_Object_Kolab_Adminrole
  • Horde_Kolab_Server_Object_Kolab_Distlist
  • Horde_Kolab_Server_Object_Kolab_Domainmaintainer
  • Horde_Kolab_Server_Object_Kolab_Maintainer
  • Horde_Kolab_Server_Object_Kolab_User
  • Horde_Kolab_Server_Object_Kolabgermanbankarrangement
  • Horde_Kolab_Server_Object_Kolabgroupofnames
  • Horde_Kolab_Server_Object_Kolabinetorgperson
  • Horde_Kolab_Server_Object_Kolabpop3account
  • Horde_Kolab_Server_Object_Kolabsharedfolder
  • Horde_Kolab_Server_Object_Mcached
  • Horde_Kolab_Server_Object_Organizationalperson
  • Horde_Kolab_Server_Object_Person
  • Horde_Kolab_Server_Object_Top
  • Horde_Kolab_Server_Objects_Base
  • Horde_Kolab_Server_Query_Element_And
  • Horde_Kolab_Server_Query_Element_Approx
  • Horde_Kolab_Server_Query_Element_Begins
  • Horde_Kolab_Server_Query_Element_Contains
  • Horde_Kolab_Server_Query_Element_Ends
  • Horde_Kolab_Server_Query_Element_Equals
  • Horde_Kolab_Server_Query_Element_Greater
  • Horde_Kolab_Server_Query_Element_Group
  • Horde_Kolab_Server_Query_Element_Less
  • Horde_Kolab_Server_Query_Element_Mapped
  • Horde_Kolab_Server_Query_Element_Not
  • Horde_Kolab_Server_Query_Element_Or
  • Horde_Kolab_Server_Query_Element_Single
  • Horde_Kolab_Server_Query_Ldap
  • Horde_Kolab_Server_Result_Ldap
  • Horde_Kolab_Server_Schema_Base
  • Horde_Kolab_Server_Schema_Decorator_Cache
  • Horde_Kolab_Server_Search_Base
  • Horde_Kolab_Server_Search_Operation_Addressesforuidormail
  • Horde_Kolab_Server_Search_Operation_Attributes
  • Horde_Kolab_Server_Search_Operation_Base
  • Horde_Kolab_Server_Search_Operation_Children
  • Horde_Kolab_Server_Search_Operation_Constraint_Single
  • Horde_Kolab_Server_Search_Operation_Constraint_Strict
  • Horde_Kolab_Server_Search_Operation_Groupsformember
  • Horde_Kolab_Server_Search_Operation_Guid
  • Horde_Kolab_Server_Search_Operation_Guidforalias
  • Horde_Kolab_Server_Search_Operation_Guidforcn
  • Horde_Kolab_Server_Search_Operation_Guidforkolabusers
  • Horde_Kolab_Server_Search_Operation_Guidformail
  • Horde_Kolab_Server_Search_Operation_Guidformailoralias
  • Horde_Kolab_Server_Search_Operation_Guidforuid
  • Horde_Kolab_Server_Search_Operation_Guidforuidormail
  • Horde_Kolab_Server_Search_Operation_Guidforuidormailoralias
  • Horde_Kolab_Server_Search_Operation_Mailforuidormail
  • Horde_Kolab_Server_Search_Operation_Restrictgroups
  • Horde_Kolab_Server_Search_Operation_Restrictkolab
  • Horde_Kolab_Server_Structure_Attribute_Double
  • Horde_Kolab_Server_Structure_Attribute_Value
  • Horde_Kolab_Server_Structure_Base
  • Horde_Kolab_Server_Structure_Kolab
  • Horde_Kolab_Server_Structure_Ldap

Interfaces

  • Horde_Kolab_Server_Connection_Interface
  • Horde_Kolab_Server_Interface
  • Horde_Kolab_Server_List_Interface
  • Horde_Kolab_Server_Object_Attribute_Interface
  • Horde_Kolab_Server_Object_Interface
  • Horde_Kolab_Server_Object_Searches
  • Horde_Kolab_Server_Objects_Interface
  • Horde_Kolab_Server_Query_Element_Interface
  • Horde_Kolab_Server_Query_Interface
  • Horde_Kolab_Server_Result_Interface
  • Horde_Kolab_Server_Schema_Interface
  • Horde_Kolab_Server_Search_Interface
  • Horde_Kolab_Server_Search_Operation_Interface
  • Horde_Kolab_Server_Structure_Attribute_Interface
  • Horde_Kolab_Server_Structure_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * A Horde_Kolab_Server:: factory.
  4:  *
  5:  * PHP version 5
  6:  *
  7:  * @category Kolab
  8:  * @package  Kolab_Server
  9:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 10:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 11:  * @link     http://pear.horde.org/index.php?package=Kolab_Server
 12:  */
 13: 
 14: /**
 15:  * A based Horde_Kolab_Server:: factory.
 16:  *
 17:  * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
 18:  *
 19:  * See the enclosed file COPYING for license information (LGPL). If you
 20:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 21:  *
 22:  * @category Kolab
 23:  * @package  Kolab_Server
 24:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 25:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 26:  * @link     http://pear.horde.org/index.php?package=Kolab_Server
 27:  */
 28: class Horde_Kolab_Server_Factory
 29: {
 30:     /**
 31:      * Return the suggested interface bindings for the Kolab Server components.
 32:      *
 33:      * @return array The bindings.
 34:      */
 35:     public function getBindings()
 36:     {
 37:         return array(
 38:             array(
 39:                 'Horde_Kolab_Server_Objects_Interface',
 40:                 'Horde_Kolab_Server_Objects_Base'
 41:             ),
 42:             array(
 43:                 'Horde_Kolab_Server_Search_Interface',
 44:                 'Horde_Kolab_Server_Search_Base'
 45:             ),
 46:             array(
 47:                 'Horde_Kolab_Server_Schema_Interface',
 48:                 'Horde_Kolab_Server_Schema_Base'
 49:             ),
 50:         );
 51:     }
 52: 
 53:     /**
 54:      * Setup the machinery to create a Horde_Kolab_Server_Structure handler.
 55:      *
 56:      * @param array $configuration The configuration parameters for the
 57:      *                             connection. (@todo: describe parameters)
 58:      *
 59:      * @return Horde_Kolab_Server_Structure_Interface
 60:      */
 61:     private function getStructure(array $configuration)
 62:     {
 63:         if (!isset($configuration['driver'])) {
 64:             $driver = 'Horde_Kolab_Server_Structure_Kolab';
 65:         } else {
 66:             $driver = $configuration['driver'];
 67:         }
 68:         return new $driver();
 69:     }
 70: 
 71:     /**
 72:      * Return the server connection that should be used.
 73:      *
 74:      * @param array $configuration The configuration parameters for the
 75:      *                             connection. (@todo: describe parameters)
 76:      *
 77:      * @return Horde_Kolab_Server_Connection The connection to the server.
 78:      */
 79:     public function getConnection(array $configuration)
 80:     {
 81:         if (empty($configuration['mock'])) {
 82:             if (!isset($configuration['basedn'])) {
 83:                 throw new Horde_Exception('The parameter \'basedn\' is missing in the Kolab server configuration!');
 84:             }
 85: 
 86:             $ldap_read = new Horde_Ldap($configuration);
 87:             if (isset($configuration['host_master'])) {
 88:                 $configuration['host'] = $configuration['host_master'];
 89:                 $ldap_write = new Horde_Ldap($configuration);
 90:                 $connection = new Horde_Kolab_Server_Connection_Splittedldap(
 91:                     $ldap_read, $ldap_write
 92:                 );
 93:             } else {
 94:                 $connection = new Horde_Kolab_Server_Connection_Simpleldap(
 95:                     $ldap_read
 96:                 );
 97:             }
 98:             return $connection;
 99:         } else {
100:             if (isset($configuration['data'])) {
101:                 $data = $configuration['data'];
102:             } else {
103:                 $data = array();
104:             }
105:             $connection = new Horde_Kolab_Server_Connection_Mock(
106:                 new Horde_Kolab_Server_Connection_Mock_Ldap(
107:                     $configuration, $data
108:                 )
109:             );
110:             return $connection;
111:         }
112:     }
113: 
114:     /**
115:      * Return the server connection that should be used.
116:      *
117:      * @param array $configuration     The configuration parameters for the
118:      *                                 server. (@todo: describe parameters)
119:      * @param mixed $logger The logger (@todo: which methods need to be provided?)
120:      *
121:      * @return Horde_Kolab_Server_Interface The Horde_Kolab_Server connection.
122:      */
123:     public function getServer(array $configuration, $logger)
124:     {
125:         $connection = $this->getConnection($configuration);
126: 
127:         if (!isset($configuration['filter'])) {
128:             $server = new Horde_Kolab_Server_Ldap_Standard(
129:                 $connection,
130:                 $configuration['basedn']
131:             );
132:         } else {
133:             $server = new Horde_Kolab_Server_Ldap_Filtered(
134:                 $connection,
135:                 $configuration['basedn'],
136:                 $configuration['filter']
137:             );
138:         }
139: 
140:         if (isset($configuration['map'])) {
141:             $server = new Horde_Kolab_Server_Decorator_Map(
142:                 $server, $configuration['map']
143:             );
144:         }
145: 
146:         if (isset($configuration['debug']) || isset($configuration['log'])) {
147:             $server = new Horde_Kolab_Server_Decorator_Log(
148:                 $server, $logger
149:             );
150:         }
151: 
152:         if (isset($configuration['debug']) || isset($configuration['count'])) {
153:             $server = new Horde_Kolab_Server_Decorator_Count(
154:                 $server, $logger
155:             );
156:         }
157: 
158:         if (!empty($configuration['cleanup'])) {
159:             $server = new Horde_Kolab_Server_Decorator_Clean(
160:                 $server
161:             );
162:         }
163:         return $server;
164:     }
165: }
API documentation generated by ApiGen