I am adding the ability to add add-on to my plugin. Right now i am using:
foreach(glob(GMW_PATH .'/plugins/*', GLOB_ONLYDIR) as $dir) {
include_once $dir . '/connect.php';
}
The function loop trough all the folders inside the "plugins" folder in my plugin and includes the connect.php file that is inside each of those folders (each add-on folder include the connect.php file).
This is the first time i am using GLOB_ONLYDIR and i am not sure about its performance. Is it a good idea to use the above or should i create each add-on as a stand alone plugin, which they actually are, but add the a ability to just activate them from the plugins page?
Thank you.