From da4205e236a6cb9c05d6940be1db9a2cb8d16b8e Mon Sep 17 00:00:00 2001 From: Max Kremmel Date: Tue, 1 Aug 2006 14:26:23 +0000 Subject: fix undefined constant definition error during installation --- LibertySystem.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'LibertySystem.php') diff --git a/LibertySystem.php b/LibertySystem.php index b10be7b..9125b6e 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.34 2006/07/31 07:44:48 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.35 2006/08/01 14:26:23 squareing Exp $ * @author spider */ @@ -150,15 +150,18 @@ class LibertySystem extends LibertyBase { // if no current default format or no format plugins active // activate format.tikiwiki and make it the default format plugin - if( $format_plugin_count == 0 || $default_format_found == 0 ) { + // This happens during installation and therefore requires that we include the plugin file for the constant definitions + $plugin_file = LIBERTY_PKG_PATH.'plugins/format.tikiwiki.php'; + if( $format_plugin_count == 0 || $default_format_found == 0 && is_file( $plugin_file ) ) { + require_once( $plugin_file ); $guid = PLUGIN_GUID_TIKIWIKI; $config_name = "{$this->mSystem}_plugin_status_" . $guid; $config_value = 'y'; - $gBitSystem->storeConfig($config_name, $config_value, LIBERTY_PKG_NAME); + $gBitSystem->storeConfig( $config_name, $config_value, LIBERTY_PKG_NAME ); $gBitSystem->storeConfig( 'default_format', PLUGIN_GUID_TIKIWIKI, LIBERTY_PKG_NAME ); //make memory match db $this->loadActivePlugins(); - } + } // remove any config settings for plugins that were not on disk $active_plugins = $gBitSystem->getConfigMatch("/^{$this->mSystem}_plugin_status_/i"); @@ -171,8 +174,6 @@ class LibertySystem extends LibertyBase { $gBitSystem->storeConfig($config_name, NULL, LIBERTY_PKG_NAME); } } - - } /** -- cgit v1.3