Remove Horde_Core and PEAR dependencies from Horde_Util
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 17 Mar 2010 22:59:41 +0000 (16:59 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 17 Mar 2010 23:01:08 +0000 (17:01 -0600)
framework/Util/lib/Horde/String.php
framework/Util/lib/Horde/Util.php
framework/Util/package.xml

index 409b726..60ad2bf 100644 (file)
@@ -99,14 +99,14 @@ class Horde_String
         }
 
         if (is_object($input)) {
-            // PEAR_Error objects are almost guaranteed to contain recursion,
-            // which will cause a segfault in PHP.  We should never reach
-            // this line, but add a check and a log message to help the devs
-            // track down and fix this issue.
-            if (is_a($input, 'PEAR_Error')) {
-                Horde::logMessage('Called convertCharset() on a PEAR_Error object. ' . print_r($input, true), 'DEBUG');
+            // PEAR_Error/Exception objects are almost guaranteed to contain
+            // recursion, which will cause a segfault in PHP. We should never
+            // reach this line, but add a check.
+            if (($input instanceof Exception) ||
+                ($input instanceof PEAR_Error)) {
                 return '';
             }
+
             $input = Horde_Util::cloneObject($input);
             $vars = get_object_vars($input);
             while (list($key, $val) = each($vars)) {
index 589c2ad..6ed6848 100644 (file)
@@ -91,7 +91,6 @@ class Horde_Util
             }
 
             $caller .= ' on line ' . $bt[0]['line'] . ' of ' . $bt[0]['file'];
-            Horde::logMessage('Horde_Util::cloneObject called on variable of type ' . gettype($obj) . ' by ' . $caller, 'DEBUG');
 
             $ret = $obj;
             return $ret;
index a7aefb8..b4baf04 100644 (file)
@@ -77,12 +77,12 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <pearinstaller>
     <min>1.5.4</min>
    </pearinstaller>
-  </required>
-  <optional>
    <package>
-    <name>PEAR</name>
-    <channel>pear.php.net</channel>
+    <name>Url</name>
+    <channel>pear.horde.org</channel>
    </package>
+  </required>
+  <optional>
    <extension>
     <name>iconv</name>
    </extension>