/**
* A library for accessing the Kolab user database.
*
- *
* PHP version 5
*
* @category Kolab
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-/** We need PEAR */
-require_once 'PEAR.php';
+/**
+ * The Autoloader allows us to omit "require/include" statements.
+ */
+require_once 'Horde/Autoloader.php';
/** Provide access to the Kolab specific objects. */
require_once 'Horde/Kolab/Server/Object.php';
* This class provides methods to deal with Kolab objects stored in
* the Kolab object db.
*
- *
* Copyright 2008-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server
+abstract class Horde_Kolab_Server
{
/**
*
* @var string
*/
- var $uid;
+ public $uid;
/**
* Valid Kolab object types
*
* @param array $params Parameter array.
*/
- function Horde_Kolab_Server($params = array())
+ public function __construct($params = array())
{
$this->_params = $params;
if (isset($params['uid'])) {
*/
function &factory($driver, $params = array())
{
- $driver = basename($driver);
- if (empty($driver) || $driver == 'none') {
- $db = new Horde_Kolab_Server($params);
- return $db;
- }
-
- if (file_exists(dirname(__FILE__) . '/Server/' . $driver . '.php')) {
- include_once dirname(__FILE__) . '/Server/' . $driver . '.php';
- }
-
$class = 'Horde_Kolab_Server_' . $driver;
if (class_exists($class)) {
$db = new $class($params);
*
* @param array $params Parameter array.
*/
- function Horde_Kolab_Server_test($params = array())
+ function __construct($params = array())
{
if (isset($params['data'])) {
$GLOBALS['KOLAB_SERVER_TEST_DATA'] = $params['data'];
$GLOBALS['KOLAB_SERVER_TEST_DATA'] = array();
}
}
- Horde_Kolab_Server::Horde_Kolab_Server($params);
+ parent::__construct($params);
}
/**
/**
* Test the server class.
*
- *
* PHP version 5
*
* @category Kolab
*/
/**
- * We need the unit test framework
+ * We need the unit test framework
*/
require_once 'PHPUnit/Framework.php';
-require_once 'Horde/Kolab/Server.php';
+/**
+ * The Autoloader allows us to omit "require/include" statements.
+ */
+require_once 'Horde/Autoloader.php';
/**
* Tests for the main server class.
*
- *
* Copyright 2008-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
}
}
+
+/**
+ * A dummy class to test the original abstract class.
+ *
+ * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Kolab
+ * @package Kolab_Server
+ * @author Gunnar Wrobel <wrobel@pardus.de>
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Kolab_Server
+ */
+class Horde_Kolab_Server_none extends Horde_Kolab_Server
+{
+}