Fix installer to work with the new framework architecture

pull/66/head
Thomas Bruederli 12 years ago
parent fdbe5a8804
commit dc088e25c2

@ -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;
}

@ -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]';

@ -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');

@ -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');
Loading…
Cancel
Save