diff options
author | thomascube <thomas@roundcube.net> | 2008-04-12 13:54:45 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-04-12 13:54:45 +0000 |
commit | 47124c2279382714afd8dbe4a867a867ea179199 (patch) | |
tree | 9ce67f4521f466d8718604a23d74de1786189efd /installer/index.php | |
parent | b00bd0f27d1c066d04fc8124c3a35465a5933ab1 (diff) |
Changed codebase to PHP5 with autoloader + added some new classes from the devel-vnext branch
Diffstat (limited to 'installer/index.php')
-rw-r--r-- | installer/index.php | 23 |
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(); |