*
* @var Horde_Kolab_Server
*/
- public $server;
+ private $_server;
/**
* The structure handler for this server.
*
* @var Horde_Kolab_Server_Structure
*/
- public $structure;
+ private $_structure;
/**
* The search handler for this server.
*
* @var Horde_Kolab_Server_Search
*/
- public $search;
+ private $_search;
/**
* The object handler for this server.
*
* @var Horde_Kolab_Server_Objects
*/
- public $objects;
+ private $_objects;
/**
* The schema handler for this server.
*
* @var Horde_Kolab_Server_Schema
*/
- public $schema;
+ private $_schema;
/**
* Construct a new Horde_Kolab_Server object.
Horde_Kolab_Server_Search $search,
Horde_Kolab_Server_Schema $schema
) {
- $this->server = $server;
- $this->objects = $objects;
- $this->structure = $structure;
- $this->search = $search;
- $this->schema = $schema;
+ $this->_server = $server;
+ $this->_objects = $objects;
+ $this->_structure = $structure;
+ $this->_search = $search;
+ $this->_schema = $schema;
$structure->setComposite($this);
$search->setComposite($this);
}
/**
+ * Retrieve an object attribute.
+ *
+ * @param string $key The name of the attribute.
+ *
+ * @return mixed The atribute value.
+ *
+ * @throws Horde_Kolab_Server_Exception If the attribute does not exist.
+ */
+ public function __get($key)
+ {
+ $public = array('server', 'objects', 'structure', 'search', 'schema');
+ if (in_array($key, $public)) {
+ $priv_key = '_' . $key;
+ return $this->$priv_key;
+ }
+ throw new Horde_Kolab_Server_Exception(
+ sprintf('Attribute %s not supported!', $key)
+ );
+ }
+
+ /**
* Connect to the server. Use this method if the user name you can provide
* does not match a DN. In this case it will be required to map this user
* name first.
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_File extends Horde_Kolab_Server_Test
+class Horde_Kolab_Server_Connection_File
+extends Horde_Kolab_Server_Connection_Mock
{
/**
*
* @throws Horde_Kolab_Server_Exception If the connection failed.
*/
- public function connectGuid($guid = null, $pass = null)
+ public function connectGuid($guid = '', $pass = '')
{
$this->_server->connectGuid($guid, $pass);
}
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Object_Attribute_Value
-extends Horde_Kolab_Server_Object_Attribute_Empty
+class Horde_Kolab_Server_Object_Attribute_Empty
+extends Horde_Kolab_Server_Object_Attribute_Value
{
/**
* Return the value of this attribute.
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-abstract class Horde_Kolab_Server_Object_Attribute_Value
+abstract class Horde_Kolab_Server_Object_Attribute_Field
extends Horde_Kolab_Server_Object_Attribute_Base
{
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
class Horde_Kolab_Server_Object_Hash
-implements Horde_Kolab_Server_Object, ArrayAccess
+implements Horde_Kolab_Server_Object
+//@todo: Implement ArrayAccess
{
/**
* Link to the decorated object.
{
$this->_object->delete();
}
+
+ /**
+ * Generates an ID for the given information.
+ *
+ * @param array &$info The data of the object.
+ *
+ * @return string The ID.
+ */
+ public function generateId(array &$info)
+ {
+ $this->_object->generateId($info);
+ }
+
+ /**
+ * Distill the server side object information to save.
+ *
+ * @param array &$info The information about the object.
+ *
+ * @return NULL.
+ *
+ * @throws Horde_Kolab_Server_Exception If the given information contains errors.
+ */
+ public function prepareObjectInformation(array &$info)
+ {
+ $this->_object->prepareObjectInformation($info);
+ }
+
+ /**
+ * Returns the set of actions supported by this object type.
+ *
+ * @return array An array of supported actions.
+ */
+ public function getActions()
+ {
+ $this->_object->getActions();
+ }
}
*
* @return string|PEAR_Error The ID.
*/
- public function generateId(&$info)
+ public function generateId(array &$info)
{
return self::ATTRIBUTE_K . '=kolab';
}
*
* @var array
*/
- protected $object_classes = array(
+ static public $object_classes = array(
self::OBJECTCLASS_TOP,
self::OBJECTCLASS_INETORGPERSON,
self::OBJECTCLASS_KOLABINETORGPERSON,
*
* @return boolean|PEAR_Error True on success.
*/
- public function save($info = null)
+ public function save(array $info)
{
$admin_group = new Horde_Kolab_Server_Object_Kolabgroupofnames($this->server, null, $this->required_group);
*
* @throws Horde_Kolab_Server_Exception If the given information contains errors.
*/
- public function prepareObjectInformation(&$info)
+ public function prepareObjectInformation(array &$info)
{
foreach ($info[self::ATTRIBUTE_DOMAIN] as $domain) {
$domain_uid = sprintf('cn=%s,cn=domain,cn=internal,%s',
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Object_Kolabsharedfolder extends Horde_Kolab_Server_Object
+class Horde_Kolab_Server_Object_Kolabsharedfolder extends Horde_Kolab_Server_Object_Top
{
/** Define attributes specific to this object type */
*
* @return string|PEAR_Error The ID.
*/
- public function generateId(&$info)
+ public function generateId(array &$info)
{
return self::ATTRIBUTE_CN . '=' . $this->server->structure->quoteForUid(trim($info['cn'], " \t\n\r\0\x0B,"));
}
}
/**
+ * Read the object data.
+ *
+ * @return array The read data.
+ */
+ public function readInternal()
+ {
+ $this->_cache_int = array_merge(
+ $this->_cache_int,
+ $this->_object->readInternal()
+ );
+ }
+
+ /**
* Get the specified attribute of this object
*
* @param string $attr The attribute to read
throw new Horde_Kolab_Server_Exception(sprintf("Attribute \"%s\" not supported!",
$attr));
}
- $this->_cache_int = array_merge(
- $this->_cache_int,
- $this->_object->readInternal()
- );
+ $this->_object->readInternal();
if (!isset($this->_cache_int[$attr])) {
throw new Horde_Kolab_Server_Exception(sprintf("Failed to read attribute \"%s\"!",
$attr));
}
/**
+ * Generates an ID for the given information.
+ *
+ * @param array &$info The data of the object.
+ *
+ * @return string The ID.
+ */
+ public function generateId(array &$info)
+ {
+ $this->_object->generateId($info);
+ }
+
+ /**
+ * Distill the server side object information to save.
+ *
+ * @param array &$info The information about the object.
+ *
+ * @return NULL.
+ *
+ * @throws Horde_Kolab_Server_Exception If the given information contains errors.
+ */
+ public function prepareObjectInformation(array &$info)
+ {
+ $this->_object->prepareObjectInformation($info);
+ }
+
+ /**
* Returns the set of actions supported by this object type.
*
* @return array An array of supported actions.
*
* @return mixed The search result.
*/
- public function search()
- {
- }
+ public function search();
}
\ No newline at end of file
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Object_Search_Guid
+class Horde_Kolab_Server_Object_Search_Attributes
extends Horde_Kolab_Server_Object_Search_Base
{
/**
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-abstract class Horde_Kolab_Server_Object_Search_Base implements Horde_Kolab_Server_Object_Search
+abstract class Horde_Kolab_Server_Object_Search_Base
+implements Horde_Kolab_Server_Object_Search
{
/**
* A link to the composite server handler.
<file name="Novalue.php" role="php" />
</dir> <!-- /lib/Horde/Kolab/Server/Exception -->
<file name="Factory.php" role="php" />
+ <dir name="Factory">
+ <file name="Base.php" role="php" />
+ <file name="Cleaned.php" role="php" />
+ <file name="Configuration.php" role="php" />
+ <file name="Conn.php" role="php" />
+ <dir name="Conn">
+ <file name="Base.php" role="php" />
+ <file name="Injector.php" role="php" />
+ <file name="Ldap.php" role="php" />
+ <file name="Mock.php" role="php" />
+ </dir> <!-- /lib/Horde/Kolab/Server/Factory/Conn -->
+ <file name="Constructor.php" role="php" />
+ <file name="Default.php" role="php" />
+ <file name="Injector.php" role="php" />
+ <file name="Kolab.php" role="php" />
+ <file name="Logged.php" role="php" />
+ <file name="Mapped.php" role="php" />
+ </dir> <!-- /lib/Horde/Kolab/Server/Factory -->
<file name="Ldap.php" role="php" />
<dir name="Ldap">
<file name="Changes.php" role="php" />
<file name="Kolabgroupofnames.php" role="php" />
<file name="Kolabinetorgperson.php" role="php" />
<file name="Kolabpop3account.php" role="php" />
- <file name="Kolabsharedfolder.php" role="php" />
+ <file name="Kolabsharedfolder.php" role="php" />
<file name="Organizationalperson.php" role="php" />
<file name="Person.php" role="php" />
+ <file name="Search.php" role="php" />
+ <dir name="Search">
+ <file name="Attributes.php" role="php" />
+ <file name="Base.php" role="php" />
+ <file name="Children.php" role="php" />
+ <dir name="Constraint">
+ <file name="Single.php" role="php" />
+ <file name="Strict.php" role="php" />
+ </dir> <!-- /lib/Horde/Kolab/Server/Object/Constraint -->
+ <file name="Guid.php" role="php" />
+ </dir> <!-- /lib/Horde/Kolab/Server/Object/Search -->
<file name="Searches.php" role="php" />
<file name="Top.php" role="php" />
<dir name="Kolab">
<install name="lib/Horde/Kolab/Server/Exception.php" as="Horde/Kolab/Server/Exception.php" />
<install name="lib/Horde/Kolab/Server/Exception/Novalue.php" as="Horde/Kolab/Server/Exception/Novalue.php" />
<install name="lib/Horde/Kolab/Server/Factory.php" as="Horde/Kolab/Server/Factory.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Base.php" as="Horde/Kolab/Server/Factory/Base.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Cleaned.php" as="Horde/Kolab/Server/Factory/Cleaned.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Configuration.php" as="Horde/Kolab/Server/Factory/Configuration.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Conn.php" as="Horde/Kolab/Server/Factory/Conn.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Conn/Base.php" as="Horde/Kolab/Server/Factory/Conn/Base.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Conn/Injector.php" as="Horde/Kolab/Server/Factory/Conn/Injector.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Conn/Ldap.php" as="Horde/Kolab/Server/Factory/Conn/Ldap.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Conn/Mock.php" as="Horde/Kolab/Server/Factory/Conn/Mock.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Constructor.php" as="Horde/Kolab/Server/Factory/Constructor.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Default.php" as="Horde/Kolab/Server/Factory/Default.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Injector.php" as="Horde/Kolab/Server/Factory/Injector.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Kolab.php" as="Horde/Kolab/Server/Factory/Kolab.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Logged.php" as="Horde/Kolab/Server/Factory/Logged.php" />
+ <install name="lib/Horde/Kolab/Server/Factory/Mapped.php" as="Horde/Kolab/Server/Factory/Mapped.php" />
<install name="lib/Horde/Kolab/Server/Ldap.php" as="Horde/Kolab/Server/Ldap.php" />
<install name="lib/Horde/Kolab/Server/Ldap/Changes.php" as="Horde/Kolab/Server/Ldap/Changes.php" />
<install name="lib/Horde/Kolab/Server/Ldap/Filtered.php" as="Horde/Kolab/Server/Ldap/Filtered.php" />
<install name="lib/Horde/Kolab/Server/Object/Kolab/User.php" as="Horde/Kolab/Server/Object/Kolab/User.php" />
<install name="lib/Horde/Kolab/Server/Object/Organizationalperson.php" as="Horde/Kolab/Server/Object/Organizationalperson.php" />
<install name="lib/Horde/Kolab/Server/Object/Person.php" as="Horde/Kolab/Server/Object/Person.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search.php" as="Horde/Kolab/Server/Object/Search.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Attributes.php" as="Horde/Kolab/Server/Object/Search/.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Base.php" as="Horde/Kolab/Server/Object/Search/Base.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Children.php" as="Horde/Kolab/Server/Object/Search/Children.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Constraint/Single.php" as="Horde/Kolab/Server/Object/Search/Constraint/Single.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Constraint/Strict.php" as="Horde/Kolab/Server/Object/Search/Constraint/Strict.php" />
+ <install name="lib/Horde/Kolab/Server/Object/Search/Guid.php" as="Horde/Kolab/Server/Object/Search/Guid.php" />
<install name="lib/Horde/Kolab/Server/Object/Searches.php" as="Horde/Kolab/Server/Object/Searches.php" />
<install name="lib/Horde/Kolab/Server/Object/Top.php" as="Horde/Kolab/Server/Object/Top.php" />
<install name="lib/Horde/Kolab/Server/Objects.php" as="Horde/Kolab/Server/Objects.php" />
{
public function setUp()
{
+ $this->markTestIncomplete();
$this->injector = new Horde_Injector(new Horde_Injector_TopLevel());
}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit>
+ <filter>
+ <whitelist>
+ <directory suffix=".php">../../../../lib</directory>
+ </whitelist>
+ </filter>
+</phpunit>