forked from GNUsocial/gnu-social
[MODULES] Make ModulesManager check if file exists
This commit is contained in:
parent
43e56c08f7
commit
17da1f7fb5
@ -45,10 +45,11 @@ abstract class ModulesManager
|
|||||||
|
|
||||||
foreach ($plugins_paths as $plugin_path) {
|
foreach ($plugins_paths as $plugin_path) {
|
||||||
$class_name = basename($plugin_path);
|
$class_name = basename($plugin_path);
|
||||||
$qualified = 'Plugin\\' . $class_name . '\\' . $class_name;
|
$fqcn = "Plugin\\{$class_name}\\{$class_name}";
|
||||||
|
$file = "{$plugin_path}/{$class_name}.php";
|
||||||
require_once $plugin_path . '/' . $class_name . '.php';
|
if (file_exists($file)) {
|
||||||
$class = new $qualified;
|
require_once $file;
|
||||||
|
$class = new $fqcn;
|
||||||
self::$modules[] = $class;
|
self::$modules[] = $class;
|
||||||
|
|
||||||
// Register event handlers
|
// Register event handlers
|
||||||
@ -61,3 +62,4 @@ abstract class ModulesManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user