diff options
| author | Christian Fowler <spider@viovio.com> | 2006-12-26 04:59:39 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2006-12-26 04:59:39 +0000 |
| commit | 792ba869cffb768a37bed203269a3e33b9b59c89 (patch) | |
| tree | 0c51f2de580d91315669e5c2bc91a303fddfb4dd | |
| parent | 98b3b0cb1c7acb5af4b5885c6b2c8434bfa04c3b (diff) | |
| download | liberty-792ba869cffb768a37bed203269a3e33b9b59c89.tar.gz liberty-792ba869cffb768a37bed203269a3e33b9b59c89.tar.bz2 liberty-792ba869cffb768a37bed203269a3e33b9b59c89.zip | |
handle plugins that have an invalid path in the DB, but can be found in the default liberty/plugins dir
| -rwxr-xr-x | LibertySystem.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/LibertySystem.php b/LibertySystem.php index 2e9ddea..009297e 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.51 2006/12/23 18:38:05 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.52 2006/12/26 04:59:39 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -106,11 +106,18 @@ class LibertySystem extends LibertyBase { global $gBitSystem; $active_plugins = $gBitSystem->getConfigMatch( "/^{$this->mSystem}_plugin_status_/i", 'y' ); foreach( $active_plugins as $key=>$value ) { - $plugin_guid = preg_replace( "/^{$this->mSystem}_plugin_status_/", '', $key,1 ); - $plugin_file_name = $gBitSystem->getConfig( "{$this->mSystem}_plugin_file_$plugin_guid" ); - if ( file_exists( $plugin_file_name ) ) { - $this->mPluginFileName = $plugin_file_name; - include_once( $plugin_file_name ); + $pluginGuid = preg_replace( "/^{$this->mSystem}_plugin_status_/", '', $key,1 ); + $pluginFile = $gBitSystem->getConfig( "{$this->mSystem}_plugin_file_$pluginGuid" ); + // check for the plugin in the default location - in case bitweaver root path changed. + if ( file_exists( $pluginFile ) ) { + $this->mPluginFileName = $pluginFile; + include_once( $pluginFile ); + } else { + $defaultFile = LIBERTY_PKG_PATH.'plugins/'.basename( $pluginFile ); + if( file_exists( $defaultFile ) ) { + $this->mPluginFileName = $defaultFile; + include_once( $defaultFile ); + } } } } |
