From dc088e25c2e96969705de7424bf18390b1505354 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Sun, 25 Nov 2012 17:49:42 +0100 Subject: Fix installer to work with the new framework architecture --- installer/index.php | 12 +++++----- installer/rcube_install.php | 6 ++--- installer/test.php | 4 ++-- installer/utils.php | 56 --------------------------------------------- 4 files changed, 11 insertions(+), 67 deletions(-) delete mode 100644 installer/utils.php (limited to 'installer') diff --git a/installer/index.php b/installer/index.php index 5e7d318ff..40dabc893 100644 --- a/installer/index.php +++ b/installer/index.php @@ -40,8 +40,8 @@ ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT)); ini_set('display_errors', 1); define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/'); -define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config'); -define('RCMAIL_CHARSET', 'UTF-8'); +define('RCUBE_INSTALL_PATH', INSTALL_PATH); +define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config'); $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR; $include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR; @@ -50,10 +50,10 @@ $include_path .= ini_get('include_path'); set_include_path($include_path); -require_once 'utils.php'; -require_once 'rcube_shared.inc'; +require_once 'Roundcube/bootstrap.php'; +require_once 'rcube_install.php'; // deprecated aliases (to be removed) -require_once 'rcube_bc.inc'; +require_once 'bc.php'; session_start(); @@ -123,7 +123,7 @@ if ($RCI->configured && empty($_REQUEST['_step'])) { if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) { // header("HTTP/1.0 404 Not Found"); echo '

The installer is disabled!

'; - echo '

To enable it again, set $rcmail_config[\'enable_installer\'] = true; in RCMAIL_CONFIG_DIR/main.inc.php

'; + echo '

To enable it again, set $rcmail_config[\'enable_installer\'] = true; in RCUBE_CONFIG_DIR/main.inc.php

'; echo ''; exit; } diff --git a/installer/rcube_install.php b/installer/rcube_install.php index e120366ab..b3208f037 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -109,12 +109,12 @@ class rcube_install */ function _load_config($suffix) { - if (is_readable($main_inc = RCMAIL_CONFIG_DIR . '/main.inc' . $suffix)) { + if (is_readable($main_inc = RCUBE_CONFIG_DIR . '/main.inc' . $suffix)) { include($main_inc); if (is_array($rcmail_config)) $this->config += $rcmail_config; } - if (is_readable($db_inc = RCMAIL_CONFIG_DIR . '/db.inc'. $suffix)) { + if (is_readable($db_inc = RCUBE_CONFIG_DIR . '/db.inc'. $suffix)) { include($db_inc); if (is_array($rcmail_config)) $this->config += $rcmail_config; @@ -149,7 +149,7 @@ class rcube_install */ function create_config($which, $force = false) { - $out = @file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist"); + $out = @file_get_contents(RCUBE_CONFIG_DIR . "/{$which}.inc.php.dist"); if (!$out) return '[Warning: could not read the config template file]'; diff --git a/installer/test.php b/installer/test.php index 28eb76940..836ef1365 100644 --- a/installer/test.php +++ b/installer/test.php @@ -3,8 +3,8 @@

Check config files

config)) { $RCI->pass('main.inc.php'); diff --git a/installer/utils.php b/installer/utils.php deleted file mode 100644 index 0e6cfecf3..000000000 --- a/installer/utils.php +++ /dev/null @@ -1,56 +0,0 @@ - | - +-------------------------------------------------------------------------+ -*/ - -/** - * Use PHP5 autoload for dynamic class loading - * (copy from program/include/iniset.php) - */ -function __autoload($classname) -{ - $filename = preg_replace( - array( - '/Mail_(.+)/', - '/Net_(.+)/', - '/Auth_(.+)/', - '/^html_.+/', - '/^utf8$/' - ), - array( - 'Mail/\\1', - 'Net/\\1', - 'Auth/\\1', - 'html', - 'utf8.class' - ), - $classname - ); - include_once $filename. '.php'; -} - -/** - * Local callback function for PEAR errors - */ -function __pear_error($err) -{ - rcmail::raise_error(array( - 'code' => $err->getCode(), - 'message' => $err->getMessage(), - )); -} - -// set PEAR error handling (will also load the PEAR main class) -PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, '__pear_error'); -- cgit v1.2.3