fixing up the "is setup" check in the installer
[gwvp.git] / gwvplib / gwvppluginloader.php
1 <?php
2
3 function gwvp_PluginLoader($path="")
4 {
5         if($path !=  "") {
6                 // try and find it
7                 error_log("attempting to load plugins from $path");
8                 $dh = opendir("$path");
9                 if($dh) {
10                         while(($file = readdir($dh))!==false) {
11                                 $mt = preg_match("/.*.php$/", $file);
12                                 if($mt > 0) {
13                                         error_log("loading plugin $file");
14                                         require_once("$path/$file");
15                                         //echo "required $basedir/$file\n";
16                                 }
17                         }
18                 }                       
19         }
20 }
21
22 // we assume the config is loaded, but this is where it works:
23 error_log("begin plugin load");
24 if(isset($plugin_path)) {
25         error_log("path set");
26         if(is_dir($plugin_path)) {
27                 error_log("is dir, beginning load");
28                 gwvp_PluginLoader($plugin_path);
29         }
30 }
31
32 ?>