summaryrefslogtreecommitdiff
path: root/installer/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'installer/index.php')
-rw-r--r--installer/index.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/installer/index.php b/installer/index.php
index cb5f3febd..f6fa47975 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -3,8 +3,26 @@
ini_set('error_reporting', E_ALL&~E_NOTICE);
ini_set('display_errors', 1);
+define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
+$include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR . INSTALL_PATH . 'program' . PATH_SEPARATOR . INSTALL_PATH . 'program/include' . PATH_SEPARATOR . ini_get('include_path');
+set_include_path($include_path);
+
session_start();
+/**
+ * Use PHP5 autoload for dynamic class loading
+ * (copy from program/incllude/iniset.php)
+ */
+function __autoload($classname)
+{
+ $filename = preg_replace(
+ array('/MDB2_(.+)/', '/Mail_(.+)/', '/^html_.+/', '/^utf8$/'),
+ array('MDB2/\\1', 'Mail/\\1', 'html', 'utf8.class'),
+ $classname
+ );
+ include_once $filename. '.php';
+}
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -32,11 +50,6 @@ session_start();
<?php
- $docroot = realpath(dirname(__FILE__) . '/../');
- $include_path = $docroot . '/program/lib' . PATH_SEPARATOR . $docroot . '/program' . PATH_SEPARATOR . ini_get('include_path');
- set_include_path($include_path);
-
- require_once 'rcube_install.php';
$RCI = rcube_install::get_instance();
$RCI->load_config();