diff options
| author | Jams H Thompson <jht001@users.sourceforge.net> | 2006-07-23 00:56:02 +0000 |
|---|---|---|
| committer | Jams H Thompson <jht001@users.sourceforge.net> | 2006-07-23 00:56:02 +0000 |
| commit | 382a9abff62ce3c49c2fdd2a5b7d6d456d4c8d48 (patch) | |
| tree | f756391a14a72a12c7180df9bce7d3f8b3c478d9 | |
| parent | 27eef6deec6d7e4d63010f5de56dbf2414654166 (diff) | |
| download | liberty-382a9abff62ce3c49c2fdd2a5b7d6d456d4c8d48.tar.gz liberty-382a9abff62ce3c49c2fdd2a5b7d6d456d4c8d48.tar.bz2 liberty-382a9abff62ce3c49c2fdd2a5b7d6d456d4c8d48.zip | |
improve package management and performance, eliminate some package related install errors
| -rwxr-xr-x | LibertySystem.php | 13 | ||||
| -rw-r--r-- | bit_setup_inc.php | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/LibertySystem.php b/LibertySystem.php index c2d17c2..ce386aa 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.30 2006/07/11 15:09:20 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.31 2006/07/23 00:56:02 jht001 Exp $ * @author spider <spider@steelsun.com> */ @@ -104,10 +104,14 @@ class LibertySystem extends LibertyBase { * * @return none **/ - function scanPlugins( $pPluginsPath = NULL ) { + function scanPlugins( $pPluginsPath = NULL, $pOnlyScanActive = FALSE ) { if( empty( $pPluginsPath ) ) { $pPluginsPath = LIBERTY_PKG_PATH.'plugins/'; } + + // only loading the active plugins would save lots of work for most sites that don't use all the plugins + // not clear how to accomplish this unless we store the plugin file name in the DB like we do + // for packages... or we store a guid => to file name table somewhere... if( $pluginDir = opendir( $pPluginsPath ) ) { // Make two passes through the root - 1. to define the DEFINES, and 2. to include the $pScanFile's while (false !== ($plugin = readdir($pluginDir))) { @@ -116,6 +120,10 @@ class LibertySystem extends LibertyBase { } } } + + // keep plugin list in sorted order + asort( $this->mPlugins ); + // match up storage_type_id to plugin_guids. this _id varies from install to install, but guids are the same foreach( array_keys( $this->mPlugins ) as $guid ) { $handler = &$this->mPlugins[$guid]; //shorthand var alias @@ -136,7 +144,6 @@ class LibertySystem extends LibertyBase { $this->mDb->query( $sql, array( $guid, $handler['plugin_type'], $handler['description'], $handler['is_active'] ) ); } } - asort( $this->mPlugins ); } /** diff --git a/bit_setup_inc.php b/bit_setup_inc.php index c1ac272..1f08c85 100644 --- a/bit_setup_inc.php +++ b/bit_setup_inc.php @@ -3,7 +3,7 @@ * base package include * * @author spider <spider@steelsun.com> - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @package liberty * @subpackage functions */ @@ -13,6 +13,7 @@ global $gBitSystem, $gBitUser, $gBitSmarty; $registerHash = array( 'package_name' => 'liberty', 'package_path' => dirname( __FILE__ ).'/', + 'required_package'=> TRUE, ); $gBitSystem->registerPackage( $registerHash ); |
