From c3c994c7614068c3434cfb0e3671ae19e6e17df6 Mon Sep 17 00:00:00 2001 From: Sean Lee Date: Wed, 22 Feb 2006 03:13:31 +0000 Subject: Move SchemaDefault INSERTs after creation of users_users and users_group records. Thanks, spiderr. No more constraint violations were seen as of this moment. --- install_packages.php | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'install_packages.php') diff --git a/install_packages.php b/install_packages.php index 3e8b98e..0549ff6 100644 --- a/install_packages.php +++ b/install_packages.php @@ -1,6 +1,6 @@ storePreference( 'package_phpbb', 'y', PHPBB_PKG_NAME ); } - // 4. run the defaults through afterwards so we can be sure all tables needed have been created - foreach( array_keys( $gBitInstaller->mPackages ) as $package ) { - if( in_array( $package, $_REQUEST['packages'] ) || ( empty( $gBitInstaller->mPackages[$package]['installed'] ) && !empty( $gBitInstaller->mPackages[$package]['required'] ) ) ) { - if( $method == 'install' || $method == 'reinstall' ) { - // this list of installed packages is used to show newly installed packages - if( !empty( $gBitInstaller->mPackages[$package]['defaults'] ) ) { - foreach( $gBitInstaller->mPackages[$package]['defaults'] as $def ) { - if ($gBitInstaller->mDb->mType == 'firebird' ) $def = preg_replace("/\\\'/","''", $def ); - $gBitInstaller->mDb->query( $def ); - } - } - } else { - // This is where any links to clear data not in the current package will be processed - } - // this is to list any processed packages - $packageList[$method][] = $package; - } - } // only install modules during the first install if( isset( $_SESSION['first_install'] ) && $_SESSION['first_install'] == TRUE ) { /** @@ -265,6 +247,27 @@ if( !empty( $_REQUEST['cancel'] ) ) { unset( $_SESSION['email'] ); } + // 4. run the defaults through afterwards so we can be sure all tables needed have been created + foreach( array_keys( $gBitInstaller->mPackages ) as $package ) { + if (!empty($package)) { + if( in_array( $package, $_REQUEST['packages'] ) || ( empty( $gBitInstaller->mPackages[$package]['installed'] ) && !empty( $gBitInstaller->mPackages[$package]['required'] ) ) ) { + if( $method == 'install' || $method == 'reinstall' ) { + // this list of installed packages is used to show newly installed packages + if( !empty( $gBitInstaller->mPackages[$package]['defaults'] ) ) { + foreach( $gBitInstaller->mPackages[$package]['defaults'] as $def ) { + if ($gBitInstaller->mDb->mType == 'firebird' ) $def = preg_replace("/\\\'/","''", $def ); + $gBitInstaller->mDb->query( $def ); + } + } + } else { + // This is where any links to clear data not in the current package will be processed + } + // this is to list any processed packages + $packageList[$method][] = $package; + } + } + } + $gBitSmarty->assign( 'next_step', $step + 1 ); asort( $packageList ); $gBitSmarty->assign( 'packageList', $packageList ); -- cgit v1.3