summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-02-08 21:51:13 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-02-08 21:51:13 +0000
commitbbae8f2346df71bb8ae3ebadd77484fd75d21e47 (patch)
tree38b5e1150fc8e80c9c0f2800201885cb3451377e
parent5a5be3152bddf3aba2f10fbb1991356ba75b9ff8 (diff)
downloadinstall-bbae8f2346df71bb8ae3ebadd77484fd75d21e47.tar.gz
install-bbae8f2346df71bb8ae3ebadd77484fd75d21e47.tar.bz2
install-bbae8f2346df71bb8ae3ebadd77484fd75d21e47.zip
php: introduce new method: getPref( $package, $pref, $defaut ) (order is open for discussion
tpl: $gBitPref.package.pref applied package name to all saves - should make database more organised and should allow more reliable uninstalls in the future
-rw-r--r--BitInstaller.php8
-rw-r--r--install_bit_settings.php26
-rw-r--r--install_cleanup.php4
-rw-r--r--install_data.php6
-rw-r--r--install_packages.php6
5 files changed, 26 insertions, 24 deletions
diff --git a/BitInstaller.php b/BitInstaller.php
index 116cfd5..d0b2c1d 100644
--- a/BitInstaller.php
+++ b/BitInstaller.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.14 2006/02/03 18:32:34 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.15 2006/02/08 21:51:13 squareing Exp $
* @package install
*/
@@ -292,7 +292,7 @@ if( !is_array( $gBitSystem->mUpgrades[$package][$i] ) ) {
}
// turn on features that are turned on
if( $gBitSystem->isFeatureActive( 'feature_'.$package ) ) {
- $gBitSystem->storePreference( 'package_'.$package, 'y', $package );
+ $gBitSystem->storePreference( 'package_'.$package, 'y', KERNEL_PKG_NAME );
}
}
}
@@ -306,8 +306,8 @@ function process_sql_file( $file, $gBitDbType, $pBitDbPrefix ) {
global $failedcommands;
global $gBitSmarty;
if(!isset($succcommands)) {
- $succcommands=array();
- $failedcommands=array();
+ $succcommands=array();
+ $failedcommands=array();
}
if( !file_exists( INSTALL_PKG_PATH.'db/'.$file ) ) {
diff --git a/install_bit_settings.php b/install_bit_settings.php
index 57a4d02..a055c9f 100644
--- a/install_bit_settings.php
+++ b/install_bit_settings.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/install_bit_settings.php,v 1.9 2006/02/06 00:07:18 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/install_bit_settings.php,v 1.10 2006/02/08 21:51:13 squareing Exp $
* @package install
* @subpackage functions
*/
@@ -12,11 +12,11 @@
// assign next step in installation process
$gBitSmarty->assign( 'next_step',$step );
-function simple_set_value($feature) {
+function simple_set_value( $package, $feature ) {
global $_REQUEST, $gBitSystem, $gBitSmarty;
- if (isset($_REQUEST[$feature])) {
- $gBitSystem->storePreference($feature, $_REQUEST[$feature]);
- $gBitSmarty->assign($feature, $_REQUEST[$feature]);
+ if( isset( $_REQUEST[$feature] ) ) {
+ $gBitSystem->storePreference( $feature, $_REQUEST[$feature], $package );
+ $gBitSmarty->assign( $feature, $_REQUEST[$feature] );
}
}
@@ -25,11 +25,11 @@ $gBitSmarty->assign_by_ref( 'schema', $gBitInstaller->mPackages );
// settings that aren't just toggles
$formInstallValues = array(
- 'bit_index',
- 'feature_server_name',
- 'site_title',
- 'site_slogan',
- 'bitlanguage',
+ 'bit_index' => 'kernel',
+ 'feature_server_name' => 'kernel',
+ 'site_title' => 'kernel',
+ 'site_slogan' => 'kernel',
+ 'bitlanguage' => 'languages',
);
if( extension_loaded( 'imagick' ) && extension_loaded( 'gd' ) ) {
@@ -44,16 +44,18 @@ $gBitSmarty->assign_by_ref("languages",$languages );
// process form
if( isset( $_REQUEST['fSubmitBitSettings'] ) ) {
- foreach( $formInstallValues as $item ) {
- simple_set_value( $item );
+ foreach( $formInstallValues as $item => $package) {
+ simple_set_value( $package, $item );
}
if (empty($_REQUEST['bitlanguage'])) {
$_REQUEST['bitlanguage'] = 'en';
}
+
if (!array_key_exists($_REQUEST['bitlanguage'], $languages)) {
$languages[$_REQUEST['bitlanguage']] = '';
}
+
$gBitLanguage->setLanguage( $_REQUEST['bitlanguage'] );
$gBitSmarty->assign( "siteLanguage",$languages[$_REQUEST['bitlanguage']] );
// advance a step in the installer
diff --git a/install_cleanup.php b/install_cleanup.php
index eb7923b..d5f31b8 100644
--- a/install_cleanup.php
+++ b/install_cleanup.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/install_cleanup.php,v 1.3 2006/01/14 19:54:34 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/install_cleanup.php,v 1.4 2006/02/08 21:51:13 squareing Exp $
* @package install
* @subpackage functions
*/
@@ -71,7 +71,7 @@ if( !empty( $_REQUEST['resolve_conflicts'] ) ) {
foreach( $serviceList as $service ) {
foreach( array_keys( $service ) as $package ) {
if( !in_array( $package, $_REQUEST['packages'] ) ) {
- $gBitSystem->storePreference( 'package_'.$package, 'n' );
+ $gBitSystem->storePreference( 'package_'.$package, 'n', KERNEL_PKG_NAME );
$deActivated[] = $package;
}
}
diff --git a/install_data.php b/install_data.php
index 2203ae6..3cdbb51 100644
--- a/install_data.php
+++ b/install_data.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_install/Attic/install_data.php,v 1.5 2006/02/06 00:07:18 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/Attic/install_data.php,v 1.6 2006/02/08 21:51:13 squareing Exp $
* @package install
* @subpackage functions
*/
@@ -32,11 +32,11 @@ if( isset( $_REQUEST['fSubmitDataPump'] ) ) {
$gBitSmarty->assign( 'pumpedData',$pumpedData );
$app = '_done';
$gBitSmarty->assign( 'next_step',$step + 1 );
- $gBitSystem->storePreference( 'wiki_home_page',$pumpedData['Wiki'][0] );
+ $gBitSystem->storePreference( 'wiki_home_page', $pumpedData['Wiki'][0], WIKI_PKG_NAME );
} elseif( isset( $_REQUEST['skip'] ) ) {
$app = '_done';
$goto = $step + 1;
$gBitSmarty->assign( 'next_step',$goto );
header( "Location: install.php?step=$goto" );
}
-?> \ No newline at end of file
+?>
diff --git a/install_packages.php b/install_packages.php
index da95f8c..6f969b2 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.27 2006/02/06 00:07:18 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_install/install_packages.php,v 1.28 2006/02/08 21:51:13 squareing Exp $
* @package install
* @subpackage functions
*/
@@ -151,7 +151,7 @@ if( !empty( $_REQUEST['cancel'] ) ) {
$gBitInstaller->storePreference( 'package_'.strtolower( $package ), 'y', $package );
// we'll default wiki to the home page
if( defined( 'WIKI_PKG_NAME' ) && $package == WIKI_PKG_NAME ) {
- $gBitSystem->storePreference( "bit_index", WIKI_PKG_NAME );
+ $gBitSystem->storePreference( "bit_index", WIKI_PKG_NAME, WIKI_PKG_NAME );
}
} elseif( $method == 'uninstall' ) {
// TODO: allow option to remove related content from liberty_content and liberty_structures
@@ -175,7 +175,7 @@ if( !empty( $_REQUEST['cancel'] ) ) {
// and let's turn on phpBB so people can find it easily.
if( defined( 'PHPBB_PKG_NAME' ) ) {
- $gBitInstaller->storePreference( 'package_phpbb', 'y' );
+ $gBitInstaller->storePreference( 'package_phpbb', 'y', PHPBB_PKG_NAME );
}
// 4. run the defaults through afterwards so we can be sure all tables needed have been created