From 86b516e14a040daa5171b8bc7256e25b8c069510 Mon Sep 17 00:00:00 2001 From: secretr Date: Mon, 8 Nov 2010 09:22:03 +0000 Subject: [PATCH] autoload will respect main plugin class now (e.g. plugin_myplug class located in /myplug/myplug.php) --- class2.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/class2.php b/class2.php index 16b9a4cea..f58990daa 100644 --- a/class2.php +++ b/class2.php @@ -2100,7 +2100,16 @@ function __autoload($className) array_shift($tmp); // remove 'plugin' $end = array_pop($tmp); // check for 'shortcodes' end phrase - if (!isset($tmp[0]) || !$tmp[0]) return; // In case we get an empty class part + if (!isset($tmp[0]) || !$tmp[0]) + { + if($end) + { + // plugin root - e.g. plugin_myplug -> plugins/myplug/myplug.php, class plugin_myplug + $filename = e_PLUGIN.$end.'/'.$end.'.php'; + break; + } + return; // In case we get an empty class part + } // Currently only batches inside shortcodes/ folder are auto-detected, // read the todo for e_shortcode.php related problems