+ /**
+ * Whether the PEAR Mail_mime library is usable. This will
+ * try and load it if it is not already.
+ *
+ * @return bool
+ */
+ private static function isMailMimeUsable() {
+ static $usable = null;
+ if ( $usable === null ) {
+ // If the class is not already loaded, and it's in the include path,
+ // try requiring it.
+ if ( !class_exists( 'Mail_mime' ) && stream_resolve_include_path( 'Mail/mime.php' ) ) {
+ require_once 'Mail/mime.php';
+ }
+ $usable = class_exists( 'Mail_mime' );
+ }
+
+ return $usable;
+ }
+
+ /**
+ * Whether the PEAR Mail library is usable. This will
+ * try and load it if it is not already.
+ *
+ * @return bool
+ */
+ private static function isMailUsable() {
+ static $usable = null;
+ if ( $usable === null ) {
+ // If the class is not already loaded, and it's in the include path,
+ // try requiring it.
+ if ( !class_exists( 'Mail' ) && stream_resolve_include_path( 'Mail.php' ) ) {
+ require_once 'Mail.php';
+ }
+ $usable = class_exists( 'Mail' );
+ }
+
+ return $usable;
+ }
+