[opw-web] Slightly cleanup usage of PEAR module



commit 9883c28a269cabb43f2d7e3b6d8a904ee66c5e61
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 10 20:06:22 2014 -0400

    Slightly cleanup usage of PEAR module
    
    Include PEAR.php if we've found the optional dependencies that
    use it.

 classes/class_cache.php |    2 +-
 classes/class_email.php |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/classes/class_cache.php b/classes/class_cache.php
index 6349131..6fddd30 100644
--- a/classes/class_cache.php
+++ b/classes/class_cache.php
@@ -22,10 +22,10 @@ class cache
         }
 
         @include('Cache/Lite.php');
-        include_once('PEAR.php');
 
         if (class_exists('Cache_Lite'))
         {
+            include_once('PEAR.php');
             $cache_path = realpath('./cache') . '/';
 
             // Set the caching options
diff --git a/classes/class_email.php b/classes/class_email.php
index 21d4dc5..f253a00 100644
--- a/classes/class_email.php
+++ b/classes/class_email.php
@@ -19,10 +19,12 @@ class email
         @include('Mail.php');
         @include('Mail/mime.php');
 
-        if (class_exists('Mail_mime'))
+        if (class_exists('Mail_mime') and class_exists('Mail'))
         {
             global $config;
 
+            include_once('PEAR.php');
+
             // Set the SMTP server options
             $options = array(
                 'host'    => $config->smtp_host,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]