This package needs no dependency on Horde_Exception.
authorGunnar Wrobel <p@rdus.de>
Wed, 23 Jun 2010 17:09:09 +0000 (19:09 +0200)
committerGunnar Wrobel <wrobel@temple.(none)>
Wed, 23 Jun 2010 17:29:54 +0000 (19:29 +0200)
13 files changed:
framework/Kolab_Format/TODO
framework/Kolab_Format/lib/Horde/Kolab/Format.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Exception.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Annotation.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Contact.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Distributionlist.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Event.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Hprefs.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Note.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php
framework/Kolab_Format/package.xml
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php

index 923ca9e..eee65d5 100644 (file)
@@ -2,29 +2,29 @@
  Kolab_Format Development TODO List
 ====================================
 
- - Find a decent way of handling tags within Horde 4
+ - Remove the automatic handling of Horde preferences within this
+   package. This is a task that belongs into the application NOT into
+   this package.
 
  - Remove dependency on the Horde_Nls and Horde_String language
    settings. I currently assume we should only return UTF-8 from this
    library.
 
+ - Remove the charset conversion. It is perfectly fine to have a
+   package that expects all data in utf-8 format. Let the applications
+   handle the rest.
+
+ - Ultimately no required dependency should remain.
+
+ - Find a decent way of handling tags within Horde 4
+
  - Probably: Pull the Format_Xml_* classes into Format_Mapper_Xml_*
    classes.
 
  - Add log decorators.
 
- - Remove the automatic handling of Horde preferences within this
-   package. This is a task that belongs into the application NOT into
-   this package.
-
- - Remove the charset conversion. It is perfectly fine to have a
-   package that expects all data in utf-8 format. Let the applications
-   handle the rest.
-
  - Remove the use of the Horde_Date class from testing. It should be
    no problem to get the same code coverage without using the external
    class.
 
- - Ultimately only the dependency on Horde_Exception should remain.
-
  - Think about storing the data in iCal format.
index 63c2f50..f975739 100644 (file)
@@ -44,7 +44,7 @@ abstract class Horde_Kolab_Format
      *
      * @return mixed    The newly created concrete Horde_Kolab_Format_XML instance
      *
-     * @throws Horde_Exception If the specified driver could not be loaded.
+     * @throws Horde_Kolab_Format_Exception If the specified driver could not be loaded.
      */
     static public function &factory($format_type = '', $object_type = '',
                                     $params = null)
@@ -54,7 +54,7 @@ abstract class Horde_Kolab_Format
             $driver = call_user_func(array($class, 'factory'), $object_type,
                                      $params);
         } else {
-            throw new Horde_Exception(sprintf(_("Failed to load Kolab Format driver %s"),
+            throw new Horde_Kolab_Format_Exception(sprintf(_("Failed to load Kolab Format driver %s"),
                                               $format_type));
         }
 
@@ -89,7 +89,7 @@ abstract class Horde_Kolab_Format
      *
      * @return array The data array representing the object.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Kolab_Format_Exception
      */
     abstract public function load(&$xmltext);
 
@@ -100,7 +100,7 @@ abstract class Horde_Kolab_Format
      *
      * @return string The data as XML string.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Kolab_Format_Exception
      */
     abstract public function save($object);
 
index 08f224b..a0856af 100644 (file)
@@ -25,6 +25,6 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @link     http://pear.horde.org/index.php?package=Kolab_Format
  */
-class Horde_Kolab_Format_Exception extends Horde_Exception
+class Horde_Kolab_Format_Exception extends Exception
 {
 }
\ No newline at end of file
index 5a008b8..88adc12 100644 (file)
@@ -66,7 +66,7 @@ class Horde_Kolab_Format_Xml_Annotation extends Horde_Kolab_Format_Xml
      *
      * @return array Array with the object data
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -89,9 +89,9 @@ class Horde_Kolab_Format_Xml_Annotation extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
-    protected function _save($root, $object)
+    protected function _save(&$root, $object)
     {
         $annotations = array();
         foreach ($object as $key => $value) {
index 1fff5c0..a6526fe 100644 (file)
@@ -308,7 +308,7 @@ class Horde_Kolab_Format_Xml_Contact extends Horde_Kolab_Format_Xml
      *
      * @return array Array with the object data.
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -390,7 +390,7 @@ class Horde_Kolab_Format_Xml_Contact extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
     protected function _save(&$root, $object)
     {
index f0aa702..9e534d0 100644 (file)
@@ -68,7 +68,7 @@ class Horde_Kolab_Format_Xml_Distributionlist extends Horde_Kolab_Format_Xml
      *
      * @return array Array with data.
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -98,9 +98,9 @@ class Horde_Kolab_Format_Xml_Distributionlist extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
-    protected function _save($root, $object)
+    protected function _save(&$root, $object)
     {
         // Map the display-name of a kolab dist list to horde's lastname attribute
         if (isset($object['last-name'])) {
index 44eb365..5535e89 100644 (file)
@@ -95,7 +95,7 @@ class Horde_Kolab_Format_Xml_Event extends Horde_Kolab_Format_Xml
      *
      * @return array Array with the object data.
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -121,9 +121,9 @@ class Horde_Kolab_Format_Xml_Event extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
-    protected function _save($root, $object)
+    protected function _save(&$root, $object)
     {
         // Translate start/end date including full day events
         if (!empty($object['_is_all_day'])) {
index fa44435..9c03323 100644 (file)
@@ -76,7 +76,7 @@ class Horde_Kolab_Format_Xml_Hprefs extends Horde_Kolab_Format_Xml
      *
      * @return array The data array representing the object.
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     public function load(&$xmltext)
     {
@@ -87,7 +87,7 @@ class Horde_Kolab_Format_Xml_Hprefs extends Horde_Kolab_Format_Xml
                 $object['application'] = $object['categories'];
                 unset($object['categories']);
             } else {
-                throw new Horde_Exception('Preferences XML object is missing an application setting.');
+                throw new Horde_Kolab_Format_Exception('Preferences XML object is missing an application setting.');
             }
         }
 
@@ -101,7 +101,7 @@ class Horde_Kolab_Format_Xml_Hprefs extends Horde_Kolab_Format_Xml
      *
      * @return string The data as XML string.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
     public function save($object)
     {
@@ -110,7 +110,7 @@ class Horde_Kolab_Format_Xml_Hprefs extends Horde_Kolab_Format_Xml
                 $object['application'] = $object['categories'];
                 unset($object['categories']);
             } else {
-                throw new Horde_Exception('Preferences XML object is missing an application setting.');
+                throw new Horde_Kolab_Format_Exception('Preferences XML object is missing an application setting.');
             }
         }
 
index 70628df..da4773c 100644 (file)
@@ -74,7 +74,7 @@ class Horde_Kolab_Format_Xml_Note extends Horde_Kolab_Format_Xml
      *
      * @return array Array with the object data
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -94,9 +94,9 @@ class Horde_Kolab_Format_Xml_Note extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
-    protected function _save($root, $object)
+    protected function _save(&$root, $object)
     {
         $object['summary'] = $object['desc'];
         unset($object['desc']);
index ca11f29..0dce207 100644 (file)
@@ -119,7 +119,7 @@ class Horde_Kolab_Format_Xml_Task extends Horde_Kolab_Format_Xml
      *
      * @return array Array with data.
      *
-     * @throws Horde_Exception If parsing the XML data failed.
+     * @throws Horde_Kolab_Format_Exception If parsing the XML data failed.
      */
     protected function _load(&$children)
     {
@@ -178,9 +178,9 @@ class Horde_Kolab_Format_Xml_Task extends Horde_Kolab_Format_Xml
      *
      * @return boolean True on success.
      *
-     * @throws Horde_Exception If converting the data to XML failed.
+     * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
      */
-    protected function _save($root, $object)
+    protected function _save(&$root, $object)
     {
         $object['summary'] = $object['name'];
         unset($object['name']);
index 958f5f5..6c1fa6b 100644 (file)
     <min>1.4.0b1</min>
    </pearinstaller>
    <package>
-    <name>Exception</name>
-    <channel>pear.horde.org</channel>
-   </package>
-   <package>
     <name>Nls</name>
     <channel>pear.horde.org</channel>
    </package>
index fb0a167..5189a01 100644 (file)
@@ -81,7 +81,7 @@ extends PHPUnit_Framework_TestCase
             $xml->load($recur);
             $this->assertTrue(false);
         } catch (Exception $e) {
-            $this->assertTrue($e instanceOf Horde_Exception);
+            $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
         }
     }
 
index cd7b363..91a4a3c 100644 (file)
@@ -103,7 +103,7 @@ extends PHPUnit_Framework_TestCase
                               array('value' => Horde_Kolab_Format_Xml::VALUE_NOT_EMPTY));
             $this->assertTrue(false);
         } catch (Exception $e) {
-            $this->assertTrue($e instanceOf Horde_Exception);
+            $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
         }
 
         $xml->_updateNode($root,
@@ -122,7 +122,7 @@ extends PHPUnit_Framework_TestCase
                                     'save' => '_unknown'));
             $this->assertTrue(false);
         } catch (Exception $e) {
-            $this->assertTrue($e instanceOf Horde_Exception);
+            $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
         }
     }
 
@@ -206,7 +206,7 @@ extends PHPUnit_Framework_TestCase
                                     'type' => Horde_Kolab_Format_Xml::TYPE_STRING));
             $this->assertTrue(false);
         } catch (Exception $e) {
-            $this->assertTrue($e instanceOf Horde_Exception);
+            $this->assertTrue($e instanceOf Horde_Kolab_Format_Exception);
         }
 
         // Test loading a missing value with a default