From: Gunnar Wrobel Date: Wed, 23 Jun 2010 17:09:09 +0000 (+0200) Subject: This package needs no dependency on Horde_Exception. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a1065d2b3e17349d48379e2a21a824a694127d08;p=horde.git This package needs no dependency on Horde_Exception. --- diff --git a/framework/Kolab_Format/TODO b/framework/Kolab_Format/TODO index 923ca9e71..eee65d516 100644 --- a/framework/Kolab_Format/TODO +++ b/framework/Kolab_Format/TODO @@ -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. diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format.php b/framework/Kolab_Format/lib/Horde/Kolab/Format.php index 63c2f509c..f97573916 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format.php @@ -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); diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Exception.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Exception.php index 08f224b0e..a0856afb9 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Exception.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Exception.php @@ -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 diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Annotation.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Annotation.php index 5a008b883..88adc129e 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Annotation.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Annotation.php @@ -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) { diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Contact.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Contact.php index 1fff5c056..a6526fe88 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Contact.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Contact.php @@ -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) { diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Distributionlist.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Distributionlist.php index f0aa70251..9e534d09d 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Distributionlist.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Distributionlist.php @@ -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'])) { diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Event.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Event.php index 44eb365f5..5535e8942 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Event.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Event.php @@ -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'])) { diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Hprefs.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Hprefs.php index fa44435ca..9c03323bc 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Hprefs.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Hprefs.php @@ -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.'); } } diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Note.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Note.php index 70628df88..da4773c90 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Note.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Note.php @@ -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']); diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php index ca11f2957..0dce207a0 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php @@ -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']); diff --git a/framework/Kolab_Format/package.xml b/framework/Kolab_Format/package.xml index 958f5f5df..6c1fa6bde 100644 --- a/framework/Kolab_Format/package.xml +++ b/framework/Kolab_Format/package.xml @@ -128,10 +128,6 @@ 1.4.0b1 - Exception - pear.horde.org - - Nls pear.horde.org diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php index fb0a1679a..5189a0143 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php @@ -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); } } diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php index cd7b3637e..91a4a3c23 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php @@ -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