mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-12 20:14:54 +01:00
always load config too
This commit is contained in:
parent
bc10e5f4aa
commit
7a8903f3b3
@ -50,7 +50,13 @@ class PluginService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Autoload src directory to make sure all class names can be resolved (e.g. in migrations)
|
// Load config
|
||||||
|
$config = plugin_path($plugin->id, 'config', $plugin->id . '.php');
|
||||||
|
if (file_exists($config)) {
|
||||||
|
config()->set($plugin->id, require $config);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always autoload src directory to make sure all class names can be resolved (e.g. in migrations)
|
||||||
$namespace = $plugin->namespace . '\\';
|
$namespace = $plugin->namespace . '\\';
|
||||||
if (!array_key_exists($namespace, $classLoader->getPrefixesPsr4())) {
|
if (!array_key_exists($namespace, $classLoader->getPrefixesPsr4())) {
|
||||||
$classLoader->setPsr4($namespace, plugin_path($plugin->id, 'src/'));
|
$classLoader->setPsr4($namespace, plugin_path($plugin->id, 'src/'));
|
||||||
@ -61,12 +67,6 @@ class PluginService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load config
|
|
||||||
$config = plugin_path($plugin->id, 'config', $plugin->id . '.php');
|
|
||||||
if (file_exists($config)) {
|
|
||||||
config()->set($plugin->id, require $config);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load translations
|
// Load translations
|
||||||
$translations = plugin_path($plugin->id, 'lang');
|
$translations = plugin_path($plugin->id, 'lang');
|
||||||
if (file_exists($translations)) {
|
if (file_exists($translations)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user