From c5d7c941aa16b5bd98cfd56f12bbe7c39bddc608 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 19 Dec 2012 05:43:52 -0500
Subject: [PATCH] Add unsupported alternative parts to attachments list (#1488870)

---
 program/include/iniset.php |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/program/include/iniset.php b/program/include/iniset.php
index d79fbd4..be71fc0 100644
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -20,6 +20,10 @@
  +-----------------------------------------------------------------------+
 */
 
+// application constants
+define('RCMAIL_VERSION', '0.9-git');
+define('RCMAIL_START', microtime(true));
+
 $config = array(
     // Some users are not using Installer, so we'll check some
     // critical PHP settings here. Only these, which doesn't provide
@@ -48,7 +52,7 @@
 }
 
 define('RCUBE_INSTALL_PATH', INSTALL_PATH);
-define('RCUBE_CONFIG_DIR',  RCMAIL_CONFIG_DIR);
+define('RCUBE_CONFIG_DIR',  RCMAIL_CONFIG_DIR.'/');
 
 
 // RC include folders MUST be included FIRST to avoid other
@@ -68,8 +72,26 @@
 // include Roundcube Framework
 require_once 'Roundcube/bootstrap.php';
 
-// backward compatybility (to be removed)
-require_once INSTALL_PATH . 'program/include/rcmail.php';
+// register autoloader for rcmail app classes
+spl_autoload_register('rcmail_autoload');
 
 // backward compatybility (to be removed)
 require_once INSTALL_PATH . 'program/include/bc.php';
+
+
+/**
+ * PHP5 autoloader routine for dynamic class loading
+ */
+function rcmail_autoload($classname)
+{
+    if (strpos($classname, 'rcmail') === 0) {
+        $filepath = INSTALL_PATH . "program/include/$classname.php";
+        if (is_readable($filepath)) {
+            include_once $filepath;
+            return true;
+        }
+    }
+
+    return false;
+}
+

--
Gitblit v1.9.1