summaryrefslogtreecommitdiff
path: root/LibertySystem.php
diff options
context:
space:
mode:
Diffstat (limited to 'LibertySystem.php')
-rwxr-xr-xLibertySystem.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/LibertySystem.php b/LibertySystem.php
index 64b9f63..334de51 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.61 2007/02/23 12:21:03 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.62 2007/02/26 22:35:01 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -135,9 +135,12 @@ class LibertySystem extends LibertyBase {
* Load all plugins found in specified directory
* Use loadActivePlugins to load only the active plugins
*
- * @return none
- **/
- function scanAllPlugins( $pPluginsPath = NULL ) {
+ * @param string $pPluginsPath Set the path where to scan for plugins
+ * @param string $pPrefixPattern Perl regex for filenames can start with to prevent inclusion of unwanted filenames (e.g. (data\.|storage\.)). Final regex: /^{$pPrefixPattern}.*\.php$/
+ * @access public
+ * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
+ */
+ function scanAllPlugins( $pPluginsPath = NULL, $pPrefixPattern = NULL ) {
global $gBitSystem;
if( empty( $pPluginsPath ) ) {
$pPluginsPath = $this->mPluginPath;
@@ -145,7 +148,8 @@ class LibertySystem extends LibertyBase {
if( $pluginDir = opendir( $pPluginsPath ) ) {
while( FALSE !== ( $plugin = readdir( $pluginDir ) ) ) {
- if( preg_match( '/\.php$/', $plugin ) ) {
+ $pattern = "/^{$pPrefixPattern}.*\.php$/";
+ if( preg_match( $pattern, $plugin ) ) {
$this->mPluginFileName = basename( $plugin );
include_once( $pPluginsPath.$plugin );
}