Add Horde_Text_Filter_Exception::
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Jul 2010 22:26:32 +0000 (16:26 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Jul 2010 21:15:33 +0000 (15:15 -0600)
framework/Text_Filter/lib/Horde/Text/Filter.php
framework/Text_Filter/lib/Horde/Text/Filter/Exception.php [new file with mode: 0644]
framework/Text_Filter/package.xml

index 9ec6f04..e0f7cba 100644 (file)
@@ -24,7 +24,7 @@ class Horde_Text_Filter
      *                        parameters a subclass might need.
      *
      * @return Horde_Text_Filter_Base  The newly created concrete instance.
-     * @throws Horde_Exception
+     * @throws Horde_Text_Filter_Exception
      */
     static public function factory($driver, $params = array())
     {
@@ -40,7 +40,7 @@ class Horde_Text_Filter
             return new $class($params);
         }
 
-        throw new Horde_Exception(__CLASS__ . ': Class definition of ' . $driver . ' not found.');
+        throw new Horde_Text_Filter_Exception(__CLASS__ . ': Class definition of ' . $driver . ' not found.');
     }
 
     /**
@@ -61,7 +61,7 @@ class Horde_Text_Filter
         foreach ($filters as $num => $filter) {
             try {
                 $filterOb = self::factory($filter, isset($params[$num]) ? $params[$num] : array());
-            } catch (Horde_Exception $e) {
+            } catch (Horde_Text_Filter_Exception $e) {
                 return $e->getMessage();
             }
             $patterns = $filterOb->getPatterns();
diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Exception.php b/framework/Text_Filter/lib/Horde/Text/Filter/Exception.php
new file mode 100644 (file)
index 0000000..fce82ad
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Exception handler for the Horde_Text_Filter package.
+ *
+ * Copyright 2010 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.
+ *
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Text_Filter
+ */
+class Horde_Text_Filter_Exception extends Horde_Exception_Prior
+{
+}
index 89584c7..e4585d3 100644 (file)
@@ -37,7 +37,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Remove Horde/Core dependency in the Emoticons driver.
+ <notes>* Add Horde_Text_Filter_Exception::.
+ * Remove Horde/Core dependency in the Emoticons driver.
  * Html2text converter now uses XML parser to generate output.
  * Add ability to define filters to use with preg_replace_callback().
  * Add 'noprefetch' parameter to XSS filter (Ticket #8836).
@@ -62,6 +63,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
        <file name="Emails.php" role="php" />
        <file name="Emoticons.php" role="php" />
        <file name="Environment.php" role="php" />
+       <file name="Exception.php" role="php" />
        <file name="Highlightquotes.php" role="php" />
        <file name="Html2text.php" role="php" />
        <file name="JavascriptMinify.php" role="php" />
@@ -204,6 +206,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <channel>pear.horde.org</channel>
    </package>
    <package>
+    <name>Exception</name>
+    <channel>pear.horde.org</channel>
+   </package>
+   <package>
     <name>Util</name>
     <channel>pear.horde.org</channel>
    </package>