From: paulr Date: Fri, 4 Nov 2011 05:54:18 +0000 (+1100) Subject: implemented a plugin loader so i can add things like X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=commitdiff_plain;h=2a3a171ba0f5059ca3e0e2ac62e6412e50cd6f76 implemented a plugin loader so i can add things like http://www.phpcaptcha.org/ without having to carry their code in my repo. hopefully should be quite simple --- diff --git a/gwvplib/gwvplib.php b/gwvplib/gwvplib.php index e0654bc..d24ec5c 100644 --- a/gwvplib/gwvplib.php +++ b/gwvplib/gwvplib.php @@ -1,5 +1,6 @@ 0) { + error_log("loading plugin $file"); + require_once("$path/$file"); + //echo "required $basedir/$file\n"; + } + } + } + } +} + +// we assume the config is loaded, but this is where it works: +error_log("begin plugin load"); +if(isset($plugin_path)) { + error_log("path set"); + if(is_dir($plugin_path)) { + error_log("is dir, beginning load"); + gwvp_PluginLoader($plugin_path); + } +} + +?> \ No newline at end of file diff --git a/gwvplib/plugins/test_plugin.php b/gwvplib/plugins/test_plugin.php new file mode 100644 index 0000000..8257f04 --- /dev/null +++ b/gwvplib/plugins/test_plugin.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/www/index.php b/www/index.php index 1bc6bc7..792b52a 100644 --- a/www/index.php +++ b/www/index.php @@ -30,8 +30,10 @@ require_once("gwvplib.php"); gwvp_goWebBegin(); //goWebGitBackEnd(); + if(function_exists("gwvp_DebugEnabled")) { gwvp_DebugEnabled(); } + ?>