summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BitInstaller.php54
-rw-r--r--install_final.php10
-rw-r--r--install_packages.php7
-rw-r--r--style/install.css5
-rw-r--r--templates/install.tpl4
-rw-r--r--templates/install_cleanup.tpl6
-rw-r--r--templates/upgrade_welcome.tpl52
-rw-r--r--upgrade_welcome.php14
8 files changed, 96 insertions, 56 deletions
diff --git a/BitInstaller.php b/BitInstaller.php
index 0f33d33..7aac8c6 100644
--- a/BitInstaller.php
+++ b/BitInstaller.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.27 2007/04/04 13:09:37 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.28 2007/04/21 14:10:41 squareing Exp $
* @package install
*/
@@ -112,7 +112,9 @@ class BitInstaller extends BitSystem {
function upgradePackage( $package ) {
global $gBitSystem, $gBitDb;
- if( !empty( $gBitSystem->mUpgrades[$package] ) ) {
+ $ret = array();
+
+ if( !empty( $gBitSystem->mUpgrades[$package] )) {
$tablePrefix = $this->getTablePrefix();
$dict = NewDataDictionary( $gBitDb->mDb );
for( $i=0; $i<count( $gBitSystem->mUpgrades[$package] ); $i++ ) {
@@ -138,10 +140,10 @@ class BitInstaller extends BitSystem {
foreach( array_keys( $create ) as $tableName ) {
$completeTableName = $tablePrefix.$tableName;
$sql = $dict->CreateTableSQL( $completeTableName, $create[$tableName], 'REPLACE' );
- if( $sql && ($dict->ExecuteSQLArray( $sql ) > 0 ) ) {
+ if( $sql && ( $dict->ExecuteSQLArray( $sql ) > 0 ) ) {
} else {
- print '<dd><span class="error">Failed to create '.$completeTableName.'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to create '.$completeTableName;
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -158,8 +160,8 @@ class BitInstaller extends BitSystem {
}
if( $sql && ($dict->ExecuteSQLArray( $sql ) > 0 ) ) {
} else {
- print '<dd><span class="error">Failed to alter '.$completeTableName.' -> '.$alter[$tableName].'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to alter '.$completeTableName.' -> '.$alter[$tableName];
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -174,8 +176,8 @@ class BitInstaller extends BitSystem {
$this->mDb->query( $query );
}
} else {
- print '<dd><span class="error">Failed to rename table '.$completeTableName.'.'.$rename[$tableName][0].' to '.$rename[$tableName][1].'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to rename table '.$completeTableName.'.'.$rename[$tableName][0].' to '.$rename[$tableName][1];
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -193,8 +195,8 @@ class BitInstaller extends BitSystem {
$this->mDb->query( $query );
}
} else {
- print '<dd><span class="error">Failed to rename column '.$completeTableName.'.'.$rename[$tableName][0].' to '.$rename[$tableName][1].'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to rename column '.$completeTableName.'.'.$rename[$tableName][0].' to '.$rename[$tableName][1];
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -215,8 +217,8 @@ class BitInstaller extends BitSystem {
//$this->mDb->DropSequence( $from );
$this->mDb->CreateSequence( $to, $id );
} else {
- print '<dd><span class="error">Failed to rename sequence '.$from.' to '.$to.'</span>';
- //array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to rename sequence '.$from.' to '.$to;
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -231,8 +233,8 @@ class BitInstaller extends BitSystem {
$this->mDb->query( $query );
}
} else {
- print '<dd><span class="error">Failed to drop column '.$completeTableName.'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to drop column '.$completeTableName;
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -245,8 +247,8 @@ class BitInstaller extends BitSystem {
$sql = $dict->DropTableSQL( $completeTableName );
if( $sql && ($dict->ExecuteSQLArray( $sql ) > 0 ) ) {
} else {
- print '<dd><span class="error">Failed to drop table '.$completeTableName.'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to drop table '.$completeTableName;
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -260,8 +262,8 @@ class BitInstaller extends BitSystem {
$this->mDb->query( $query );
}
} else {
- print '<dd><span class="error">Failed to create index '.$index.'</span>';
- array_push( $failedcommands, $sql );
+ $errors[] = 'Failed to create index '.$index;
+ $failedcommands[] = implode( " ", $sql );
}
}
}
@@ -291,7 +293,10 @@ class BitInstaller extends BitSystem {
}
if( !empty( $sql ) ) {
foreach( $sql as $query ) {
- $this->mDb->query( $query );
+ if( !$result = $this->mDb->query( $query )) {
+ $errors[] = 'Failed to execute SQL query';
+ $failedcommands[] = implode( " ", $sql );
+ }
}
$sql = NULL;
}
@@ -305,13 +310,20 @@ class BitInstaller extends BitSystem {
break;
}
}
+
// turn on features that are turned on
if( $gBitSystem->isFeatureActive( 'feature_'.$package ) ) {
$gBitSystem->storeConfig( 'package_'.$package, 'y', KERNEL_PKG_NAME );
}
+
+ if( !empty( $failedcommands )) {
+ $ret['errors'] = $errors;
+ $ret['failedcommands'] = $failedcommands;
+ }
}
- }
+ return $ret;
+ }
}
function check_session_save_path() {
diff --git a/install_final.php b/install_final.php
index 82ee54c..d2e5020 100644
--- a/install_final.php
+++ b/install_final.php
@@ -1,14 +1,4 @@
<?php
-/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/install_final.php,v 1.3 2005/08/24 20:51:21 squareing Exp $
- * @package install
- * @subpackage functions
- */
-
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
-// All Rights Reserved. See copyright.txt for details and a complete list of authors.
-// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-
// this is set to tell the progress meter to include this page --> 100% completed
$app = '_done';
if( !empty( $_SESSION['first_install'] ) ) {
diff --git a/install_packages.php b/install_packages.php
index f3f70d1..5d04b71 100644
--- a/install_packages.php
+++ b/install_packages.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/install_packages.php,v 1.55 2007/04/18 18:15:19 nickpalmer Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/install_packages.php,v 1.56 2007/04/21 14:10:41 squareing Exp $
* @package install
* @subpackage functions
*/
@@ -43,7 +43,7 @@ if( !empty( $_REQUEST['cancel'] ) ) {
// make sure no required packages are included in this list
foreach( array_keys( $gBitInstaller->mPackages ) as $package ) {
if( in_array( $package, $_REQUEST['packages'] ) && !empty( $gBitInstaller->mPackages[$package]['required'] )) {
- $gBitSmarty->assign( 'warning', "Something unexpected has happened: One of the required packaes has appeared in the list of selected packages. This generally only happens if the installation is missing a core database table. Please contact the bitweaver developers team on how to procede." );
+ $gBitSmarty->assign( 'warning', "Something unexpected has happened: One of the required packaes has appeared in the list of selected packages. This generally only happens if the installation is missing a core database table. Please contact the bitweaver developers team on how to proceed." );
$method = FALSE;
}
}
@@ -293,6 +293,9 @@ if( !empty( $_REQUEST['cancel'] ) ) {
// apparently we need to first remove the vaue from the database to make sure it's set
$gBitSystem->storeConfig( 'package_'.$package , NULL );
$gBitSystem->storeConfig( 'package_'.$package , 'y', $package );
+ if( !empty( $gBitSystem->mPackages[$package]['version'] )) {
+ $gBitSystem->storeVersion( $package, $gBitSystem->mPackages[$package]['version'] );
+ }
$gBitInstaller->mPackages[ $package ]['installed'] = TRUE;
$gBitInstaller->mPackages[ $package ]['active_switch'] = TRUE;
// we'll default wiki to the home page
diff --git a/style/install.css b/style/install.css
index 24c788e..17167d5 100644
--- a/style/install.css
+++ b/style/install.css
@@ -19,9 +19,10 @@ body {background:#124 url( images/bg.gif ) repeat; font-family:verdana, ari
table {border-collapse:collapse; padding:0; margin:0; width:100%;}
caption {font-weight:bold; padding:5px 0 0 0;}
th {text-align:left; padding:3px 5px; background:#2c4268; border-bottom:2px solid #fff; color:#fff;}
+th a {color:#ff0;}
td {padding:2px 3px; vertical-align:top;}
hr {border:1px solid #000;}
-p {margin:0; padding:1em;}
+p {margin:0.5em; padding:0.5em;}
/* titles */
h1 {font-size:160%; font-variant:small-caps;}
@@ -57,6 +58,8 @@ textarea {width:100%;}
.formfeedback {}
.formfeedback div {padding:4px; border-bottom:1px dotted #aaa;}
+.odd {background:#eee;}
+
.dialog-error,
.error {background:#fdd;}
.dialog-warning,
diff --git a/templates/install.tpl b/templates/install.tpl
index 712343d..d1f92db 100644
--- a/templates/install.tpl
+++ b/templates/install.tpl
@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
- <!-- @import url(style/install.css); -->
+ <!-- @import url({$smarty.const.INSTALL_PKG_URL}style/install.css); -->
</style>
<title>Install bitweaver - {$browserTitle}</title>
<link rel="shortcut icon" href="{$smarty.const.INSTALL_PKG_URL}favicon.ico" type="image/x-icon" />
@@ -46,7 +46,7 @@
<li class="{$step.state}">
{biticon ipackage=icons iname=`$step.icon` iexplain=`$step.state` iforce=icon}&nbsp;
{if $step.state ne 'uncompleted'}
- <a href="{$smarty.const.INSTALL_PKG_URL}{$menu_file|default:"install.php"}?step={$key}">
+ <a href="{$menu_path|default:$smarty.const.INSTALL_PKG_URL}{$menu_file|default:"install.php"}?step={$key}">
{/if}
{$step.name}
{if $step.state ne 'uncompleted'}
diff --git a/templates/install_cleanup.tpl b/templates/install_cleanup.tpl
index c75548b..2ce0f09 100644
--- a/templates/install_cleanup.tpl
+++ b/templates/install_cleanup.tpl
@@ -1,4 +1,4 @@
-<h1>Package Conflicts</h1>
+<h1>Bitweaver integrity check</h1>
<p>
{biticon ipackage="icons" iname="dialog-information" iexplain=Information}
@@ -43,7 +43,7 @@
{if $required}
<p class="error">
{biticon ipackage="icons" iname="dialog-error" iexplain=error}
- A required package is missing at least one table. This will have unpredictable results. Please make a note of the table and contact the bitweaver team on how to procede.
+ A required package is missing at least one table. This will have unpredictable results. Please make a note of the table and contact the bitweaver team on how to proceed.
If this is your first install, we recommend that you give it another shot, perhaps with fewer packages selected. You can return to the installer at any time and install more packages later.
<br />If this problem persists, we recommend that you turn on the <strong>debugging</strong> option and look for error messages regarding the above table(s). This will help the bitweaver team identify the problem more quickly when you contact them.
</p>
@@ -121,7 +121,7 @@
{else}
<p class="success">
{biticon ipackage="icons" iname="dialog-ok" iexplain=success}
- The permissioning system in your installation is up to date and does not require any adjustments.
+ The permissioning system in your installation is up to date and does not require any adjustments. Even though this is true, we recommend you visit the <a href="{$smarty.const.USERS_PKG_URL}admin/unassigned_perms.php">Unassigned Permissions</a> page at some point to ensure that all permissions are active.
</p>
{/if}
{/legend}
diff --git a/templates/upgrade_welcome.tpl b/templates/upgrade_welcome.tpl
index 4dfb416..5074ec3 100644
--- a/templates/upgrade_welcome.tpl
+++ b/templates/upgrade_welcome.tpl
@@ -3,15 +3,49 @@
{form legend="Begin the upgrade process"}
<input type="hidden" name="step" value="{$next_step}" />
- <p>Welcome to the new and improved bitweaver upgrade process. Our upgrade scripts are currently still in development and we cannot take any reponsibility for any loss of data that occurs due to the use of these scripts. Having said this, we are doing our best to make this upgrade process as reliable and complete as we possibly can. Due to this, we urge you to follow the instructions here carefully before you proceed.</p>
- <p>Initial steps before beginning the actual upgrade stages.</p>
- <p class="warning"><strong>Make a Backup</strong><br />You should have a spare dump of your database before you run this. (Of course, you already have a nightly cron job making nightly backups and scp'ing them to another host? right? right.)</p>
- <br />
- <p class="warning"><strong>Do a Trial Run first</strong><br />You should run a trial upgrade on an offline server, personal machine, etc. before you do this on your live site.</p>
- <br />
- <p class="warning"><strong>Upgrades can take a long time</strong><br />We try to override the setting in your php.ini to ensure enough time but on some systems this does not work. If you get a blank page with a non-functional site as a result, the execution time might be the reason. Please bear this in mind. The value we have set is: <strong>max_execution_time: {$max_execution_time} seconds</strong>. If you run into problems with the upgrade process and you think this might be problem, please consult the <a class="external" href="http://us2.php.net/manual/en/ref.info.php#ini.max-execution-time">php manual</a>.</p>
- <strong>{formfeedback warning=$dbWarning}</strong>
- <p>We have done our best to make sure all situations are handled. However, your install might have the one case we haven't run into yet.</p>
+ <p>
+ Welcome to the new and improved bitweaver package manager. Using this
+ package manager will allow you to download packages from our central
+ repository and apply the install or upgrade process easily.
+ </p>
+ <p>
+ Initial steps before beginning the actual upgrade stages.
+ </p>
+ <p class="warning">
+ <strong>Make a Backup</strong><br />
+ You should have a spare dump of your database before you run this. (Of
+ course, you already have a nightly cron job making nightly backups and
+ scp'ing them to another host? right? right.)
+ </p>
+ <p class="warning">
+ <strong>Do a Trial Run first</strong><br />
+ You should run a trial upgrade on an offline server, personal machine,
+ etc. before you do this on your live site.
+ </p>
+ {if $max_execution_time}
+ <p class="warning">
+ <strong>Upgrades can take a long time</strong><br />
+ We tried to override the max_execution_time setting in your php.ini
+ to ensure enough time but on some systems this does not work. If
+ you get a blank page with a non-functional site as a result, the
+ execution time might be the reason.<br />
+ The value we are trying to set max_execution_time to is 86400.
+ However, your value of {$max_execution_time} cannot be overridden
+ on your system. If you run into problems with the upgrade process
+ and you think this might be problem, please consult the
+ <a class="external" href="http://us2.php.net/manual/en/ref.info.php#ini.max-execution-time">php manual</a>
+ on how to change the value.
+ </p>
+ {/if}
+ {if $dbWarning}
+ <p class="warning">
+ {$dbWarning}
+ </p>
+ {/if}
+ <p>
+ We have done our best to make sure all situations are handled. However,
+ your install might have the one case we haven't run into yet.
+ </p>
<div class="row submit">
<input type="submit" name="fSubmitWelcome" value="{$warningSubmit|default:"Begin the Upgrade process!"}" />
diff --git a/upgrade_welcome.php b/upgrade_welcome.php
index 3413335..79db041 100644
--- a/upgrade_welcome.php
+++ b/upgrade_welcome.php
@@ -1,22 +1,20 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/upgrade_welcome.php,v 1.4 2006/05/06 22:01:53 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/upgrade_welcome.php,v 1.5 2007/04/21 14:10:41 squareing Exp $
* @package install
* @subpackage upgrade
*/
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
-// All Rights Reserved. See copyright.txt for details and a complete list of authors.
-// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-
-if( preg_match( '/mysql/', $gBitDbType ) ) {
+if( preg_match( '/mysql/', $gBitDbType )) {
$gBitSmarty->assign( 'dbWarning', 'MySQL 4.1 or greater is required to run the installer. bitweaver will support MySQL 3.23 and above, however, the upgrade process currently uses "sub-selects" which are only supported in MySQL 4.1 and higher and all other real databases.' );
$gBitSmarty->assign( 'warningSubmit', 'Click if MySQL 4.1 is installed' );
}
ini_set( "max_execution_time", "86400" );
-$gBitSmarty->assign( 'max_execution_time', ini_get( "max_execution_time" ) );
+if( ini_get( "max_execution_time" ) != 86400 ) {
+ $gBitSmarty->assign( 'max_execution_time', ini_get( "max_execution_time" ) );
+}
// assign next step in installation process
-$gBitSmarty->assign( 'next_step',$step + 1 );
+$gBitSmarty->assign( 'next_step', $step + 1 );
?>