Location: PHPKode > projects > Bcom > bcom-1.99.1/bcom/include/register_plugins.inc
<?

print 'Scanning for plugins<BR>';
if ($_dir = @opendir($_BCOM['pluginsdir'])) {
   while($_file = readdir($_dir)) {
	 if(preg_match('/^(\w*)_(\w*).inc$/',$_file,$matches)) {
		print "Attempting to register <B>$matches[1]</B> plugin <B>$matches[2]</B><BR>";
		//do some file check stuff here before final.
		if(!isset($plugs[$matches[1]])) {
			$plugs[$matches[1]] = $_file;
		} else {
			$plugs[$matches[1]] .= ';'.$_file;
		}
		print "Registered.<BR><BR>";
	 }
   }
   closedir($_dir);
}
print 'Saving Settings';
foreach($plugs as $section => $list) {
	setoption('plugins',$section,$list);
}

?>
Return current item: Bcom