mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:00:55 +08:00
parent
fa14be591c
commit
4b1a299b3c
@ -284,19 +284,19 @@ class ExtensionManager
|
||||
->flatMap(function (Extension $extension) {
|
||||
$bootstrapper = $extension->getBootstrapperPath();
|
||||
if ($this->filesystem->exists($bootstrapper)) {
|
||||
$extenders = require $bootstrapper;
|
||||
|
||||
if (is_array($extenders)) {
|
||||
return $extenders;
|
||||
}
|
||||
|
||||
// Assume that the extension has not yet switched to the new
|
||||
// bootstrap.php format, and wrap the callback in a Compat
|
||||
// extender.
|
||||
return [new Compat($extenders)];
|
||||
return (array) require $bootstrapper;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})->map(function ($extender) {
|
||||
// If an extension has not yet switched to the new bootstrap.php
|
||||
// format, it might return a function (or more of them). We wrap
|
||||
// these in a Compat extender to enjoy an unique interface.
|
||||
if ($extender instanceof \Closure) {
|
||||
return new Compat($extender);
|
||||
} else {
|
||||
return $extender;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user