Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1122 → Rev 1123

/trunk/includes/classes/OIDplus.class.php
1129,6 → 1129,7
} else {
$fake_feature = null;
}
$known_main_classes_no_namespace = array();
foreach ($ary as $plugintype_folder => $bry) {
foreach ($bry as $vendor_folder => $cry) {
foreach ($cry as $pluginname_folder => $manifest) {
1144,6 → 1145,21
continue; // Plugin is disabled
}
 
// The auto-loader of OIDplus currently does not accept PHP namespaces.
// Reason: The autoloader detects the classes inside plugins/*/*/*/*.class.php, but it cannot know
// which namespace these files have, because their folder names do not reveal the namespace.
// So it just ignores the namespace and loads all classes with the same name.
// There can be problems if two plugins have the same classname (but are in different namespaces, e.g.
// because they are made by different vendors). For example, two object types with the same PHP class name
// get mixed up getIcon()'s.
// TODO: Think about a solution; There was a discussion here https://github.com/frdl/frdl-oidplus-plugin-type-pen/issues/1
$tmp = explode('\\',$class_name);
$class_name_no_namespace = end($tmp);
if (in_array($class_name_no_namespace, $known_main_classes_no_namespace)) {
throw new OIDplusException(_L('More than one plugin has the PHP class name "%1". This is currently no supported, not even if they are in different namespaces.', $class_name_no_namespace));
}
$known_main_classes_no_namespace[] = $class_name_no_namespace;
 
// Do some basic checks on the plugin PHP main class
if (!class_exists($class_name)) {
throw new OIDplusException(_L('Plugin "%1" is erroneous', $vendor_folder . '/' . $plugintype_folder . '/' . $pluginname_folder) . ': ' . _L('Manifest declares PHP main class as "%1", but it could not be found', $class_name));