diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-11-25 17:49:42 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-11-25 17:49:42 +0100 |
commit | dc088e25c2e96969705de7424bf18390b1505354 (patch) | |
tree | 5c3a674d876998a6a95b706a3a7a24f577d7f9e1 /installer | |
parent | fdbe5a88049ae708abaf5247db96cf8e9f95f51e (diff) |
Fix installer to work with the new framework architecture
Diffstat (limited to 'installer')
-rw-r--r-- | installer/index.php | 12 | ||||
-rw-r--r-- | installer/rcube_install.php | 6 | ||||
-rw-r--r-- | installer/test.php | 4 | ||||
-rw-r--r-- | installer/utils.php | 56 |
4 files changed, 11 insertions, 67 deletions
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 '<h2 class="error">The installer is disabled!</h2>'; - echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in RCMAIL_CONFIG_DIR/main.inc.php</p>'; + echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in RCUBE_CONFIG_DIR/main.inc.php</p>'; echo '</div></body></html>'; 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 @@ <h3>Check config files</h3> <?php -$read_main = is_readable(RCMAIL_CONFIG_DIR.'/main.inc.php'); -$read_db = is_readable(RCMAIL_CONFIG_DIR.'/db.inc.php'); +$read_main = is_readable(RCUBE_CONFIG_DIR.'/main.inc.php'); +$read_db = is_readable(RCUBE_CONFIG_DIR.'/db.inc.php'); if ($read_main && !empty($RCI->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 @@ -<?php - -/* - +-------------------------------------------------------------------------+ - | Roundcube Webmail installer utilities | - | | - | Copyright (C) 2005-2011, The Roundcube Dev Team | - | | - | Licensed under the GNU General Public License version 3 or | - | any later version with exceptions for skins & plugins. | - | See the README file for a full license statement. | - | | - +-------------------------------------------------------------------------+ - | Author: Thomas Bruederli <roundcube@gmail.com> | - +-------------------------------------------------------------------------+ -*/ - -/** - * 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'); |