mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-12 22:34:55 +01:00
always autoload src
This commit is contained in:
parent
ae190b65aa
commit
bc10e5f4aa
@ -50,6 +50,12 @@ class PluginService
|
||||
}
|
||||
}
|
||||
|
||||
// Autoload src directory to make sure all class names can be resolved (e.g. in migrations)
|
||||
$namespace = $plugin->namespace . '\\';
|
||||
if (!array_key_exists($namespace, $classLoader->getPrefixesPsr4())) {
|
||||
$classLoader->setPsr4($namespace, plugin_path($plugin->id, 'src/'));
|
||||
}
|
||||
|
||||
// Filter out plugins that should not be loaded (e.g. because they are disabled or not installed yet)
|
||||
if (!$plugin->shouldLoad()) {
|
||||
continue;
|
||||
@ -73,12 +79,6 @@ class PluginService
|
||||
});
|
||||
}
|
||||
|
||||
// Autoload src directory
|
||||
$namespace = $plugin->namespace . '\\';
|
||||
if (!array_key_exists($namespace, $classLoader->getPrefixesPsr4())) {
|
||||
$classLoader->setPsr4($namespace, plugin_path($plugin->id, 'src/'));
|
||||
}
|
||||
|
||||
// Register service providers
|
||||
foreach ($plugin->getProviders() as $provider) {
|
||||
if (!class_exists($provider) || !is_subclass_of($provider, ServiceProvider::class)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user