aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--inc/lib_plugin.php30
1 files changed, 23 insertions, 7 deletions
diff --git a/inc/lib_plugin.php b/inc/lib_plugin.php
index 906d7c625dc..3fe92bd7719 100644
--- a/inc/lib_plugin.php
+++ b/inc/lib_plugin.php
@@ -67,21 +67,37 @@ class OC_PLUGIN{
}
/**
+ * Get a list of all installed plugins
+ */
+ public static function listPlugins() {
+ global $SERVERROOT;
+ $plugins = array();
+ $fd = opendir($SERVERROOT . '/plugins');
+ while ( false !== ($filename = readdir($fd)) ) {
+ if ( $filename<>'.' AND $filename<>'..' AND ('.' != substr($filename, 0, 1))) {
+ if(file_exists($SERVERROOT . '/plugins/'.$filename.'/plugin.xml')){
+ $plugins[]=$filename;
+ }
+ }
+ }
+ closedir($fd);
+ return $plugins;
+ }
+
+ /**
* Load all plugins that aren't blacklisted
*/
public static function loadPlugins() {
global $CONFIG_INSTALLED;
if($CONFIG_INSTALLED){
global $SERVERROOT;
- $plugins = array();
+ $plugins = self::listPlugins();
$blacklist=self::loadBlacklist();
- $fd = opendir($SERVERROOT . '/plugins');
- while ( false !== ($filename = readdir($fd)) ) {
- if ( $filename<>'.' AND $filename<>'..' AND ('.' != substr($filename, 0, 1)) AND array_search($filename,$blacklist)===false) {
- self::load($filename);
+ foreach($plugins as $plugin){
+ if (array_search($plugin,$blacklist)===false) {
+ self::load($plugin);
}
}
- closedir($fd);
}
}
@@ -89,7 +105,7 @@ class OC_PLUGIN{
* load the blacklist from blacklist.txt
* @return array
*/
- private static function loadBlacklist(){
+ public static function loadBlacklist(){
global $SERVERROOT;
if(count(self::$blacklist)>0){
return self::$blacklist;