diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-26 20:28:46 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-26 20:28:46 +0000 |
commit | 9c8be228a73a602ac3e91e30bf980dd1cc695a81 (patch) | |
tree | 46b3b2dc825f652410aba04f2d148b566e5b61e5 /lib/general.lib.php | |
parent | a41697ea25a58ea5db5ed46a251fb62364626b1b (diff) | |
download | ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.tar.gz ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.tar.bz2 ampache-9c8be228a73a602ac3e91e30bf980dd1cc695a81.zip |
playlist switcher, plugin interface and the shell of a lastfm plugin (need patch file)
Diffstat (limited to 'lib/general.lib.php')
-rw-r--r-- | lib/general.lib.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/general.lib.php b/lib/general.lib.php index 697e0f50..b6c7c3fc 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -988,4 +988,42 @@ function get_user_from_username($username) { } // get_user_from_username +/** + * get_plugins + * This returns a list of the plugins and their information + */ +function get_plugins() { + + /* Init our vars */ + $plugins = array(); + + /* Open the dir */ + $handle = opendir(conf('prefix') . '/modules/plugins'); + + if (!is_resource($handle)) { + debug_event('plugins','Error: Unable to read plugins directory','1'); + } + + while ($file = readdir($handle)) { + if (substr($file,-10,10) != 'plugin.php') { continue; } + + /* Make sure it isn't a subdir */ + if (!is_dir($file)) { + + /* Get the Basename */ + $plugin_name = basename($file,'.plugin.php'); + + /* Load it */ + $plugin = new Plugin($plugin_name); + $plugins[$plugin_name] = $plugin; + } // if its not a subdir + + } // end while + + + return $plugins; + +} // get_plugins + + ?> |