From 83a4e859f8ae505f06c184eb60577529ff6c4be8 Mon Sep 17 00:00:00 2001 From: thomasb Date: Sat, 12 Apr 2008 13:54:45 +0000 Subject: Changed codebase to PHP5 with autoloader + added some new classes from the devel-vnext branch git-svn-id: https://svn.roundcube.net/trunk@1291 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/installer/index.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'roundcubemail/installer/index.php') diff --git a/roundcubemail/installer/index.php b/roundcubemail/installer/index.php index cb5f3febd..f6fa47975 100644 --- a/roundcubemail/installer/index.php +++ b/roundcubemail/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'; +} + ?> @@ -32,11 +50,6 @@ session_start(); load_config(); -- cgit v1.2.3