summaryrefslogtreecommitdiff
path: root/program/include/iniset.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-27 12:13:33 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-27 12:13:33 +0100
commit60226a75d8e4a3ee9504da6eab6d8f329bb32e7b (patch)
tree4194c1f4b32fea06964029e9ce06bb18ccb05da6 /program/include/iniset.php
parent10da75f3645ff2121bbaf9d603f2e1465eddab78 (diff)
Separate the very application-specific output classes from the Roundcube framework; add autoloader for rmail* classes
Diffstat (limited to 'program/include/iniset.php')
-rw-r--r--program/include/iniset.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/program/include/iniset.php b/program/include/iniset.php
index 25ae0189b..be71fc084 100644
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -72,8 +72,26 @@ if (set_include_path($include_path) === false) {
// 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;
+}
+